Chromium Code Reviews| 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 on 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 // Opens the given file in the desktop's default manner. |full_path| must point |
| 29 // Must be called from the UI thread. | 29 // to an existing file. If |full_path| doesn't refer to an existing file, then |
|
James Hawkins
2014/09/29 21:09:14
This secondary condition "If ... doesn't refer to
asanka
2014/09/30 23:07:46
Yup. I updated the comments for ShowItemInFolder()
| |
| 30 void OpenItem(Profile* profile, const base::FilePath& full_path); | 30 // no action will be taken. Must be called on the UI thread. |
| 31 void OpenFile(Profile* profile, const base::FilePath& full_path); | |
| 32 | |
| 33 // Opens the given folder in the file manager. No action will be taken if | |
|
James Hawkins
2014/09/29 21:09:14
Why do we not say anything about |full_path| point
James Hawkins
2014/09/29 21:09:14
What is the 'file manager'? Perhaps we should be
asanka
2014/09/30 23:07:46
Comment updated.
asanka
2014/09/30 23:07:46
Comment updated.
| |
| 34 // |full_path| does not refer to an existing folder. Must be called on the UI | |
| 35 // thread. | |
| 36 void OpenFolder(Profile* profile, const base::FilePath& full_path); | |
| 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 |