OLD | NEW |
---|---|
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/strings/string16.h" | 10 #include "base/strings/string16.h" |
11 #include "ui/gfx/native_widget_types.h" | 11 #include "ui/gfx/native_widget_types.h" |
12 | 12 |
13 class GURL; | 13 class GURL; |
14 class Profile; | 14 class Profile; |
15 | 15 |
16 namespace base { | 16 namespace base { |
17 class FilePath; | 17 class FilePath; |
18 } | 18 } |
19 | 19 |
20 namespace platform_util { | 20 namespace platform_util { |
21 | 21 |
22 // Show the given file in a file manager. If possible, select the file. | 22 // Show the given file in a file manager. If possible, select the file. |
23 // The |profile| is used to determine the running profile of file manager app | 23 // The |profile| is used to determine the running profile of file manager app |
24 // in Chrome OS only. Not used in other platforms. | 24 // in Chrome OS only. Not used in other platforms. |
25 // Must be called from the UI thread. | 25 // Must be called from the UI thread. |
26 void ShowItemInFolder(Profile* profile, const base::FilePath& full_path); | 26 void ShowItemInFolder(Profile* profile, const base::FilePath& full_path); |
27 | 27 |
28 // Open the given file in the desktop's default manner. | 28 // Open the given file in the desktop's default manner. |full_path| must point |
James Hawkins
2014/09/25 17:47:26
Unfortunately it's not consistent with the rest of
asanka
2014/09/25 22:24:20
Done. Changed to "Opens". Also reworded a bit.
| |
29 // Must be called from the UI thread. | 29 // to an existing file. If the files doesn't exist or is a directory, then no |
30 void OpenItem(Profile* profile, const base::FilePath& full_path); | 30 // action will be taken. Must be called from the UI thread. |
31 void OpenFile(Profile* profile, const base::FilePath& full_path); | |
32 | |
33 // Open the given folder in the file manager. If |full_path| does not exist or | |
34 // is not a directory, the nno action will be taken. Must be called from the UI | |
James Hawkins
2014/09/25 17:47:26
"then no"
asanka
2014/09/25 22:24:20
Done. Need spell checker for comments.
| |
35 // thread. | |
36 void OpenFolder(Profile* profile, const base::FilePath& full_path); | |
hashimoto
2014/09/25 02:34:05
Please use one of "directory" and "folder", not bo
asanka
2014/09/25 22:24:20
'Folder' is consistent with the ShowItemInFolder f
| |
31 | 37 |
32 // Open the given external protocol URL in the desktop's default manner. | 38 // Open the given external protocol URL in the desktop's default manner. |
33 // (For example, mailto: URLs in the default mail user agent.) | 39 // (For example, mailto: URLs in the default mail user agent.) |
34 // Must be called from the UI thread. | 40 // Must be called from the UI thread. |
35 void OpenExternal(Profile* profile, const GURL& url); | 41 void OpenExternal(Profile* profile, const GURL& url); |
36 | 42 |
37 // Get the top level window for the native view. This can return NULL. | 43 // Get the top level window for the native view. This can return NULL. |
38 gfx::NativeWindow GetTopLevel(gfx::NativeView view); | 44 gfx::NativeWindow GetTopLevel(gfx::NativeView view); |
39 | 45 |
40 // Get the direct parent of |view|, may return NULL. | 46 // Get the direct parent of |view|, may return NULL. |
(...skipping 13 matching lines...) Expand all Loading... | |
54 #if defined(OS_MACOSX) | 60 #if defined(OS_MACOSX) |
55 // On 10.7+, back and forward swipe gestures can be triggered using a scroll | 61 // On 10.7+, back and forward swipe gestures can be triggered using a scroll |
56 // gesture, if enabled in System Preferences. This function returns true if | 62 // gesture, if enabled in System Preferences. This function returns true if |
57 // the feature is supported and enabled, and false otherwise. | 63 // the feature is supported and enabled, and false otherwise. |
58 bool IsSwipeTrackingFromScrollEventsEnabled(); | 64 bool IsSwipeTrackingFromScrollEventsEnabled(); |
59 #endif | 65 #endif |
60 | 66 |
61 } // namespace platform_util | 67 } // namespace platform_util |
62 | 68 |
63 #endif // CHROME_BROWSER_PLATFORM_UTIL_H_ | 69 #endif // CHROME_BROWSER_PLATFORM_UTIL_H_ |
OLD | NEW |