| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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_COMMON_PLATFORM_UTIL_H_ | 5 #ifndef CHROME_COMMON_PLATFORM_UTIL_H_ |
| 6 #define CHROME_COMMON_PLATFORM_UTIL_H_ | 6 #define CHROME_COMMON_PLATFORM_UTIL_H_ |
| 7 | 7 |
| 8 #include "base/gfx/native_widget_types.h" | 8 #include "base/gfx/native_widget_types.h" |
| 9 #include "base/string16.h" | 9 #include "base/string16.h" |
| 10 | 10 |
| 11 class FilePath; | 11 class FilePath; |
| 12 class GURL; |
| 12 | 13 |
| 13 namespace platform_util { | 14 namespace platform_util { |
| 14 | 15 |
| 15 // Show the given file in a file manager. If possible, select the file. | 16 // Show the given file in a file manager. If possible, select the file. |
| 16 void ShowItemInFolder(const FilePath& full_path); | 17 void ShowItemInFolder(const FilePath& full_path); |
| 17 | 18 |
| 18 // Open the given file in the desktop's default manner. | 19 // Open the given file in the desktop's default manner. |
| 19 void OpenItem(const FilePath& full_path); | 20 void OpenItem(const FilePath& full_path); |
| 20 | 21 |
| 22 // Open the given external protocol URL in the desktop's default manner. |
| 23 // (For example, mailto: URLs in the default mail user agent.) |
| 24 void OpenExternal(const GURL& url); |
| 25 |
| 21 // Get the top level window for the native view. This can return NULL. | 26 // Get the top level window for the native view. This can return NULL. |
| 22 gfx::NativeWindow GetTopLevel(gfx::NativeView view); | 27 gfx::NativeWindow GetTopLevel(gfx::NativeView view); |
| 23 | 28 |
| 24 // Get the title of the window. | 29 // Get the title of the window. |
| 25 string16 GetWindowTitle(gfx::NativeWindow window); | 30 string16 GetWindowTitle(gfx::NativeWindow window); |
| 26 | 31 |
| 27 // Returns true if |window| is the foreground top level window. | 32 // Returns true if |window| is the foreground top level window. |
| 28 bool IsWindowActive(gfx::NativeWindow window); | 33 bool IsWindowActive(gfx::NativeWindow window); |
| 29 | 34 |
| 30 // Returns true if the view is visible. The exact definition of this is | 35 // Returns true if the view is visible. The exact definition of this is |
| 31 // platform-specific, but it is generally not "visible to the user", rather | 36 // platform-specific, but it is generally not "visible to the user", rather |
| 32 // whether the view has the visible attribute set. | 37 // whether the view has the visible attribute set. |
| 33 bool IsVisible(gfx::NativeView view); | 38 bool IsVisible(gfx::NativeView view); |
| 34 | 39 |
| 35 } | 40 } |
| 36 | 41 |
| 37 #endif // CHROME_COMMON_PLATFORM_UTIL_H_ | 42 #endif // CHROME_COMMON_PLATFORM_UTIL_H_ |
| OLD | NEW |