[email protected] | dcd5776 | 2011-06-25 12:18:51 | [diff] [blame] | 1 | // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
[email protected] | 1bbb107 | 2011-06-25 01:59:21 | [diff] [blame] | 2 | // Use of this source code is governed by a BSD-style license that can be |
| 3 | // found in the LICENSE file. |
| 4 | |
[email protected] | dcd5776 | 2011-06-25 12:18:51 | [diff] [blame] | 5 | #ifndef UI_BASE_WIN_SHELL_H_ |
| 6 | #define UI_BASE_WIN_SHELL_H_ |
[email protected] | 1bbb107 | 2011-06-25 01:59:21 | [diff] [blame] | 7 | |
| 8 | #include <windows.h> |
| 9 | |
| 10 | #include "base/string16.h" |
[email protected] | 507bad5 | 2011-08-06 04:51:07 | [diff] [blame] | 11 | #include "ui/base/ui_export.h" |
[email protected] | 1bbb107 | 2011-06-25 01:59:21 | [diff] [blame] | 12 | |
| 13 | class FilePath; |
| 14 | |
[email protected] | dcd5776 | 2011-06-25 12:18:51 | [diff] [blame] | 15 | namespace ui { |
[email protected] | 1bbb107 | 2011-06-25 01:59:21 | [diff] [blame] | 16 | namespace win { |
[email protected] | 1bbb107 | 2011-06-25 01:59:21 | [diff] [blame] | 17 | // Open or run a file via the Windows shell. In the event that there is no |
| 18 | // default application registered for the file specified by 'full_path', |
| 19 | // ask the user, via the Windows "Open With" dialog. |
| 20 | // Returns 'true' on successful open, 'false' otherwise. |
[email protected] | 507bad5 | 2011-08-06 04:51:07 | [diff] [blame] | 21 | UI_EXPORT bool OpenItemViaShell(const FilePath& full_path); |
[email protected] | 1bbb107 | 2011-06-25 01:59:21 | [diff] [blame] | 22 | |
| 23 | // The download manager now writes the alternate data stream with the |
| 24 | // zone on all downloads. This function is equivalent to OpenItemViaShell |
| 25 | // without showing the zone warning dialog. |
[email protected] | 507bad5 | 2011-08-06 04:51:07 | [diff] [blame] | 26 | UI_EXPORT bool OpenItemViaShellNoZoneCheck(const FilePath& full_path); |
[email protected] | 1bbb107 | 2011-06-25 01:59:21 | [diff] [blame] | 27 | |
[email protected] | 3a1aaa9 | 2012-07-09 21:32:54 | [diff] [blame] | 28 | // Lower level function that allows opening of non-files like urls or GUIDs |
| 29 | // don't use it if one of the above will do. |mask| is a valid combination |
| 30 | // of SEE_MASK_FLAG_XXX as stated in msdn. If there is no default application |
| 31 | // registered for the item, it behaves the same as OpenItemViaShell. |
| 32 | UI_EXPORT bool OpenAnyViaShell(const string16& full_path, |
| 33 | const string16& directory, |
| 34 | DWORD mask); |
| 35 | |
[email protected] | 1bbb107 | 2011-06-25 01:59:21 | [diff] [blame] | 36 | // Ask the user, via the Windows "Open With" dialog, for an application to use |
| 37 | // to open the file specified by 'full_path'. |
| 38 | // Returns 'true' on successful open, 'false' otherwise. |
| 39 | bool OpenItemWithExternalApp(const string16& full_path); |
| 40 | |
| 41 | // Sets the application id given as the Application Model ID for the window |
| 42 | // specified. This method is used to insure that different web applications |
| 43 | // do not group together on the Win7 task bar. |
[email protected] | 507bad5 | 2011-08-06 04:51:07 | [diff] [blame] | 44 | UI_EXPORT void SetAppIdForWindow(const string16& app_id, HWND hwnd); |
[email protected] | 1bbb107 | 2011-06-25 01:59:21 | [diff] [blame] | 45 | |
[email protected] | 2de2d62 | 2011-10-21 22:07:37 | [diff] [blame] | 46 | // Sets the application icon for the window specified. |
| 47 | UI_EXPORT void SetAppIconForWindow(const string16& app_icon, HWND hwnd); |
| 48 | |
[email protected] | 19c9f90 | 2012-08-22 16:24:40 | [diff] [blame^] | 49 | // Returns true if composition is available and turned on on the current |
| 50 | // platform. |
| 51 | UI_EXPORT bool IsAeroGlassEnabled(); |
| 52 | |
[email protected] | 1bbb107 | 2011-06-25 01:59:21 | [diff] [blame] | 53 | } // namespace win |
[email protected] | dcd5776 | 2011-06-25 12:18:51 | [diff] [blame] | 54 | } // namespace ui |
[email protected] | 1bbb107 | 2011-06-25 01:59:21 | [diff] [blame] | 55 | |
[email protected] | dcd5776 | 2011-06-25 12:18:51 | [diff] [blame] | 56 | #endif // UI_BASE_WIN_SHELL_H_ |