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_base_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 the folder at |full_path| via the Windows shell. Does nothing if |
21 // default application registered for the file specified by 'full_path', | 21 // |full_path| is not a folder. |
22 // ask the user, via the Windows "Open With" dialog. | 22 // |
23 // Returns 'true' on successful open, 'false' otherwise. | 23 // Note: Must be called on a thread that allows blocking. |
24 UI_BASE_EXPORT bool OpenItemViaShell(const base::FilePath& full_path); | 24 UI_BASE_EXPORT bool OpenFolderViaShell(const base::FilePath& full_path); |
25 | |
26 // Invokes the default verb on the file specified by |full_path| via the Windows | |
27 // shell. Usually, the default verb is "open" unless specified otherwise for the | |
28 // file type. | |
29 // | |
30 // In the event that there is no default application registered for the | |
31 // specified file, asks the user via the Windows "Open With" dialog. Returns | |
32 // |true| on success. | |
33 // | |
34 // Note: Must be called on a thread that allows blocking. | |
35 UI_BASE_EXPORT bool OpenFileViaShell(const base::FilePath& full_path); | |
25 | 36 |
26 // Lower level function that allows opening of non-files like urls or GUIDs | 37 // Lower level function that allows opening of non-files like urls or GUIDs |
27 // don't use it if one of the above will do. |mask| is a valid combination | 38 // don't use it if one of the above will do. |mask| is a valid combination |
28 // of SEE_MASK_FLAG_XXX as stated in msdn. If there is no default application | 39 // of SEE_MASK_XXX as stated in MSDN. If there is no default application |
29 // registered for the item, it behaves the same as OpenItemViaShell. | 40 // registered for the item, it behaves the same as OpenFileViaShell. |
41 // | |
42 // Note: Must be called on a thread that allows blocking. | |
sky
2015/03/06 18:21:33
The synchronous/blocking nature of this code is ne
asanka
2015/03/06 21:09:40
Yeah. They are able to deal. The callers are platf
| |
30 UI_BASE_EXPORT bool OpenAnyViaShell(const base::string16& full_path, | 43 UI_BASE_EXPORT bool OpenAnyViaShell(const base::string16& full_path, |
31 const base::string16& directory, | 44 const base::string16& directory, |
32 const base::string16& args, | 45 const base::string16& args, |
33 DWORD mask); | 46 DWORD mask); |
34 | 47 |
35 // Disables the ability of the specified window to be pinned to the taskbar or | 48 // Disables the ability of the specified window to be pinned to the taskbar or |
36 // the Start menu. This will remove "Pin this program to taskbar" from the | 49 // the Start menu. This will remove "Pin this program to taskbar" from the |
37 // taskbar menu of the specified window. | 50 // taskbar menu of the specified window. |
38 UI_BASE_EXPORT bool PreventWindowFromPinning(HWND hwnd); | 51 UI_BASE_EXPORT bool PreventWindowFromPinning(HWND hwnd); |
39 | 52 |
(...skipping 24 matching lines...) Expand all Loading... | |
64 HWND hwnd); | 77 HWND hwnd); |
65 | 78 |
66 // Returns true if composition is available and turned on on the current | 79 // Returns true if composition is available and turned on on the current |
67 // platform. | 80 // platform. |
68 UI_BASE_EXPORT bool IsAeroGlassEnabled(); | 81 UI_BASE_EXPORT bool IsAeroGlassEnabled(); |
69 | 82 |
70 } // namespace win | 83 } // namespace win |
71 } // namespace ui | 84 } // namespace ui |
72 | 85 |
73 #endif // UI_BASE_WIN_SHELL_H_ | 86 #endif // UI_BASE_WIN_SHELL_H_ |
OLD | NEW |