| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef UI_BASE_WIN_SHELL_H_ | 5 #ifndef UI_BASE_WIN_SHELL_H_ |
| 6 #define UI_BASE_WIN_SHELL_H_ | 6 #define UI_BASE_WIN_SHELL_H_ |
| 7 | 7 |
| 8 #include <windows.h> | 8 #include <windows.h> |
| 9 | 9 |
| 10 #include "base/strings/string16.h" | 10 #include "base/strings/string16.h" |
| 11 #include "ui/base/ui_export.h" | 11 #include "ui/base/ui_base_export.h" |
| 12 | 12 |
| 13 namespace base { | 13 namespace base { |
| 14 class FilePath; | 14 class FilePath; |
| 15 } | 15 } |
| 16 | 16 |
| 17 namespace ui { | 17 namespace ui { |
| 18 namespace win { | 18 namespace win { |
| 19 | 19 |
| 20 // Open or run a file via the Windows shell. In the event that there is no | 20 // Open or run a file via the Windows shell. In the event that there is no |
| 21 // default application registered for the file specified by 'full_path', | 21 // default application registered for the file specified by 'full_path', |
| 22 // ask the user, via the Windows "Open With" dialog. | 22 // ask the user, via the Windows "Open With" dialog. |
| 23 // Returns 'true' on successful open, 'false' otherwise. | 23 // Returns 'true' on successful open, 'false' otherwise. |
| 24 UI_EXPORT bool OpenItemViaShell(const base::FilePath& full_path); | 24 UI_BASE_EXPORT bool OpenItemViaShell(const base::FilePath& full_path); |
| 25 | 25 |
| 26 // The download manager now writes the alternate data stream with the | 26 // The download manager now writes the alternate data stream with the |
| 27 // zone on all downloads. This function is equivalent to OpenItemViaShell | 27 // zone on all downloads. This function is equivalent to OpenItemViaShell |
| 28 // without showing the zone warning dialog. | 28 // without showing the zone warning dialog. |
| 29 UI_EXPORT bool OpenItemViaShellNoZoneCheck(const base::FilePath& full_path); | 29 UI_BASE_EXPORT bool OpenItemViaShellNoZoneCheck( |
| 30 const base::FilePath& full_path); |
| 30 | 31 |
| 31 // Lower level function that allows opening of non-files like urls or GUIDs | 32 // Lower level function that allows opening of non-files like urls or GUIDs |
| 32 // don't use it if one of the above will do. |mask| is a valid combination | 33 // don't use it if one of the above will do. |mask| is a valid combination |
| 33 // of SEE_MASK_FLAG_XXX as stated in msdn. If there is no default application | 34 // of SEE_MASK_FLAG_XXX as stated in msdn. If there is no default application |
| 34 // registered for the item, it behaves the same as OpenItemViaShell. | 35 // registered for the item, it behaves the same as OpenItemViaShell. |
| 35 UI_EXPORT bool OpenAnyViaShell(const base::string16& full_path, | 36 UI_BASE_EXPORT bool OpenAnyViaShell(const base::string16& full_path, |
| 36 const base::string16& directory, | 37 const base::string16& directory, |
| 37 const base::string16& args, | 38 const base::string16& args, |
| 38 DWORD mask); | 39 DWORD mask); |
| 39 | 40 |
| 40 // Ask the user, via the Windows "Open With" dialog, for an application to use | 41 // Ask the user, via the Windows "Open With" dialog, for an application to use |
| 41 // to open the file specified by 'full_path'. | 42 // to open the file specified by 'full_path'. |
| 42 // Returns 'true' on successful open, 'false' otherwise. | 43 // Returns 'true' on successful open, 'false' otherwise. |
| 43 bool OpenItemWithExternalApp(const base::string16& full_path); | 44 bool OpenItemWithExternalApp(const base::string16& full_path); |
| 44 | 45 |
| 45 // Disables the ability of the specified window to be pinned to the taskbar or | 46 // Disables the ability of the specified window to be pinned to the taskbar or |
| 46 // the Start menu. This will remove "Pin this program to taskbar" from the | 47 // the Start menu. This will remove "Pin this program to taskbar" from the |
| 47 // taskbar menu of the specified window. | 48 // taskbar menu of the specified window. |
| 48 UI_EXPORT bool PreventWindowFromPinning(HWND hwnd); | 49 UI_BASE_EXPORT bool PreventWindowFromPinning(HWND hwnd); |
| 49 | 50 |
| 50 // Sets the application id, app icon, relaunch command and relaunch display name | 51 // Sets the application id, app icon, relaunch command and relaunch display name |
| 51 // for the given window. | 52 // for the given window. |
| 52 UI_EXPORT void SetAppDetailsForWindow( | 53 UI_BASE_EXPORT void SetAppDetailsForWindow( |
| 53 const base::string16& app_id, | 54 const base::string16& app_id, |
| 54 const base::string16& app_icon, | 55 const base::string16& app_icon, |
| 55 const base::string16& relaunch_command, | 56 const base::string16& relaunch_command, |
| 56 const base::string16& relaunch_display_name, | 57 const base::string16& relaunch_display_name, |
| 57 HWND hwnd); | 58 HWND hwnd); |
| 58 | 59 |
| 59 // Sets the application id given as the Application Model ID for the window | 60 // Sets the application id given as the Application Model ID for the window |
| 60 // specified. This method is used to insure that different web applications | 61 // specified. This method is used to insure that different web applications |
| 61 // do not group together on the Win7 task bar. | 62 // do not group together on the Win7 task bar. |
| 62 UI_EXPORT void SetAppIdForWindow(const base::string16& app_id, HWND hwnd); | 63 UI_BASE_EXPORT void SetAppIdForWindow(const base::string16& app_id, HWND hwnd); |
| 63 | 64 |
| 64 // Sets the application icon for the window specified. | 65 // Sets the application icon for the window specified. |
| 65 UI_EXPORT void SetAppIconForWindow(const base::string16& app_icon, HWND hwnd); | 66 UI_BASE_EXPORT void SetAppIconForWindow(const base::string16& app_icon, |
| 67 HWND hwnd); |
| 66 | 68 |
| 67 // Sets the relaunch command and relaunch display name for the window specified. | 69 // Sets the relaunch command and relaunch display name for the window specified. |
| 68 // Windows will use this information for grouping on the taskbar, and to create | 70 // Windows will use this information for grouping on the taskbar, and to create |
| 69 // a shortcut if the window is pinned to the taskbar. | 71 // a shortcut if the window is pinned to the taskbar. |
| 70 UI_EXPORT void SetRelaunchDetailsForWindow( | 72 UI_BASE_EXPORT void SetRelaunchDetailsForWindow( |
| 71 const base::string16& relaunch_command, | 73 const base::string16& relaunch_command, |
| 72 const base::string16& display_name, | 74 const base::string16& display_name, |
| 73 HWND hwnd); | 75 HWND hwnd); |
| 74 | 76 |
| 75 // Returns true if composition is available and turned on on the current | 77 // Returns true if composition is available and turned on on the current |
| 76 // platform. | 78 // platform. |
| 77 UI_EXPORT bool IsAeroGlassEnabled(); | 79 UI_BASE_EXPORT bool IsAeroGlassEnabled(); |
| 78 | 80 |
| 79 } // namespace win | 81 } // namespace win |
| 80 } // namespace ui | 82 } // namespace ui |
| 81 | 83 |
| 82 #endif // UI_BASE_WIN_SHELL_H_ | 84 #endif // UI_BASE_WIN_SHELL_H_ |
| OLD | NEW |