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 CHROME_BROWSER_PLATFORM_UTIL_H_ | 5 #ifndef CHROME_BROWSER_PLATFORM_UTIL_H_ |
6 #define CHROME_BROWSER_PLATFORM_UTIL_H_ | 6 #define CHROME_BROWSER_PLATFORM_UTIL_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <string> | 9 #include <string> |
10 | 10 |
11 #include "base/string16.h" | 11 #include "base/string16.h" |
12 #include "ui/gfx/native_widget_types.h" | 12 #include "ui/gfx/native_widget_types.h" |
13 | 13 |
14 class FilePath; | 14 class FilePath; |
15 class GURL; | 15 class GURL; |
16 | 16 |
17 namespace platform_util { | 17 namespace platform_util { |
18 | 18 |
19 // Show the given file in a file manager. If possible, select the file. | 19 // Show the given file in a file manager. If possible, select the file. |
20 // Must be called from the UI thread. | |
Mark Mentovai
2011/11/09 14:22:50
This doesn’t seem to be true.
It‘s definitely tru
achuithb
2011/11/09 20:21:36
Done.
| |
20 void ShowItemInFolder(const FilePath& full_path); | 21 void ShowItemInFolder(const FilePath& full_path); |
21 | 22 |
22 // Open the given file in the desktop's default manner. | 23 // Open the given file in the desktop's default manner. |
24 // Must be called from the UI thread. | |
23 void OpenItem(const FilePath& full_path); | 25 void OpenItem(const FilePath& full_path); |
24 | 26 |
25 // Open the given external protocol URL in the desktop's default manner. | 27 // Open the given external protocol URL in the desktop's default manner. |
26 // (For example, mailto: URLs in the default mail user agent.) | 28 // (For example, mailto: URLs in the default mail user agent.) |
27 void OpenExternal(const GURL& url); | 29 void OpenExternal(const GURL& url); |
28 | 30 |
29 // Get the top level window for the native view. This can return NULL. | 31 // Get the top level window for the native view. This can return NULL. |
30 gfx::NativeWindow GetTopLevel(gfx::NativeView view); | 32 gfx::NativeWindow GetTopLevel(gfx::NativeView view); |
31 | 33 |
32 // Get the direct parent of |view|, may return NULL. | 34 // Get the direct parent of |view|, may return NULL. |
33 gfx::NativeView GetParent(gfx::NativeView view); | 35 gfx::NativeView GetParent(gfx::NativeView view); |
34 | 36 |
35 // Returns true if |window| is the foreground top level window. | 37 // Returns true if |window| is the foreground top level window. |
36 bool IsWindowActive(gfx::NativeWindow window); | 38 bool IsWindowActive(gfx::NativeWindow window); |
37 | 39 |
38 // Activate the window, bringing it to the foreground top level. | 40 // Activate the window, bringing it to the foreground top level. |
39 void ActivateWindow(gfx::NativeWindow window); | 41 void ActivateWindow(gfx::NativeWindow window); |
40 | 42 |
41 // Returns true if the view is visible. The exact definition of this is | 43 // Returns true if the view is visible. The exact definition of this is |
42 // platform-specific, but it is generally not "visible to the user", rather | 44 // platform-specific, but it is generally not "visible to the user", rather |
43 // whether the view has the visible attribute set. | 45 // whether the view has the visible attribute set. |
44 bool IsVisible(gfx::NativeView view); | 46 bool IsVisible(gfx::NativeView view); |
45 | 47 |
46 } // platform_util | 48 } // platform_util |
47 | 49 |
48 #endif // CHROME_BROWSER_PLATFORM_UTIL_H_ | 50 #endif // CHROME_BROWSER_PLATFORM_UTIL_H_ |
OLD | NEW |