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_CHROMEOS_EXTENSIONS_FILE_HANDLER_UTIL_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_EXTENSIONS_FILE_HANDLER_UTIL_H_ |
| 6 #define CHROME_BROWSER_CHROMEOS_EXTENSIONS_FILE_HANDLER_UTIL_H_ | 6 #define CHROME_BROWSER_CHROMEOS_EXTENSIONS_FILE_HANDLER_UTIL_H_ |
| 7 | 7 |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/callback.h" | 10 #include "base/callback.h" |
| 11 #include "base/platform_file.h" | 11 #include "base/platform_file.h" |
| 12 #include "chrome/common/extensions/extension.h" | 12 #include "chrome/common/extensions/extension.h" |
| 13 #include "chrome/common/extensions/url_pattern_set.h" | 13 #include "chrome/common/extensions/url_pattern_set.h" |
| 14 | 14 |
| 15 class Browser; | 15 class Browser; |
| 16 class FileBrowserHandler; | 16 class FileBrowserHandler; |
| 17 class GURL; | 17 class GURL; |
| 18 class Profile; | 18 class Profile; |
| 19 | 19 |
| 20 namespace file_handler_util { | 20 namespace file_handler_util { |
| 21 | 21 |
| 22 void UpdateFileHandlerUsageStats(Profile* profile, const std::string& task_id); | 22 void UpdateFileHandlerUsageStats(Profile* profile, const std::string& task_id); |
| 23 | 23 |
| 24 // Gets read-write file access permission flags. | 24 // Gets read-write file access permission flags. |
| 25 int GetReadWritePermissions(); | 25 int GetReadWritePermissions(); |
| 26 // Gets read-only file access permission flags. | 26 // Gets read-only file access permission flags. |
| 27 int GetReadOnlyPermissions(); | 27 int GetReadOnlyPermissions(); |
| 28 | 28 |
| 29 // Generates file task id for the file action specified by the extension. | 29 // Generates task id for the file action or Web Intent specified by the |
| 30 // extension. This is a Web Intent if |action_id| is prefixed with "http". | |
|
benwells
2012/08/27 08:02:59
Using a prefix here feels pretty hacky. Can we pas
thorogood
2012/08/29 06:34:46
Yes, I guess so, although I'd probably be keen to
thorogood
2012/08/29 08:58:08
I've taken on your first suggestion now - like I s
| |
| 30 std::string MakeTaskID(const std::string& extension_id, | 31 std::string MakeTaskID(const std::string& extension_id, |
| 31 const std::string& action_id); | 32 const std::string& action_id); |
| 32 | 33 |
| 33 // Make a task id specific to drive apps instead of extensions. | 34 // Make a task id specific to drive apps instead of extensions. |
| 34 std::string MakeDriveTaskID(const std::string& app_id, | 35 std::string MakeDriveTaskID(const std::string& app_id, |
| 35 const std::string& action_id); | 36 const std::string& action_id); |
| 36 | 37 |
| 37 // Extracts action and extension id bound to the file task. | 38 // Extracts action and extension id bound to the file task. |
| 38 bool CrackTaskID(const std::string& task_id, | 39 bool CrackTaskID(const std::string& task_id, |
| 39 std::string* target_extension_id, | 40 std::string* target_extension_id, |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 105 Browser* GetBrowser() const; | 106 Browser* GetBrowser() const; |
| 106 private: | 107 private: |
| 107 friend class base::RefCountedThreadSafe<FileTaskExecutor>; | 108 friend class base::RefCountedThreadSafe<FileTaskExecutor>; |
| 108 | 109 |
| 109 Profile* profile_; | 110 Profile* profile_; |
| 110 }; | 111 }; |
| 111 | 112 |
| 112 } // namespace file_handler_util | 113 } // namespace file_handler_util |
| 113 | 114 |
| 114 #endif // CHROME_BROWSER_CHROMEOS_EXTENSIONS_FILE_HANDLER_UTIL_H_ | 115 #endif // CHROME_BROWSER_CHROMEOS_EXTENSIONS_FILE_HANDLER_UTIL_H_ |
| OLD | NEW |