Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(536)

Unified Diff: chrome/browser/chromeos/extensions/file_handler_util.h

Issue 10834383: Chrome OS "open with" picker allowing Web Intents (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: benwells' changes Created 8 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/chromeos/extensions/file_handler_util.h
diff --git a/chrome/browser/chromeos/extensions/file_handler_util.h b/chrome/browser/chromeos/extensions/file_handler_util.h
index 6fb8d25fc8106fc8a97b440cd532a8618b8e7c01..3823910c4819952fc30898687618a3c22231bc5f 100644
--- a/chrome/browser/chromeos/extensions/file_handler_util.h
+++ b/chrome/browser/chromeos/extensions/file_handler_util.h
@@ -19,6 +19,14 @@ class Profile;
namespace file_handler_util {
+// Specifies the task type for a task id that represents some file action, Drive
+// action, or Web Intent action.
+enum TaskType {
+ TASK_FILE = 1,
+ TASK_DRIVE,
+ TASK_WEBINTENT
+};
+
void UpdateFileHandlerUsageStats(Profile* profile, const std::string& task_id);
// Gets read-write file access permission flags.
@@ -26,17 +34,15 @@ int GetReadWritePermissions();
// Gets read-only file access permission flags.
int GetReadOnlyPermissions();
-// Generates file task id for the file action specified by the extension.
+// Generates task id for the action specified by the extension.
std::string MakeTaskID(const std::string& extension_id,
+ TaskType task_type,
const std::string& action_id);
-// Make a task id specific to drive apps instead of extensions.
-std::string MakeDriveTaskID(const std::string& app_id,
- const std::string& action_id);
-
-// Extracts action and extension id bound to the file task.
+// Extracts action, type and extension id bound to the task.
bool CrackTaskID(const std::string& task_id,
std::string* target_extension_id,
+ TaskType* task_type,
std::string* action_id);
// Struct that keeps track of when a handler was `last used.
@@ -73,13 +79,11 @@ typedef base::Callback<void(bool)> FileTaskFinishedCallback;
// Helper class for executing file browser file action.
class FileTaskExecutor : public base::RefCountedThreadSafe<FileTaskExecutor> {
public:
- static const char kDriveTaskExtensionPrefix[];
- static const size_t kDriveTaskExtensionPrefixLength;
-
// Creates the appropriate FileTaskExecutor for the given |extension_id|.
static FileTaskExecutor* Create(Profile* profile,
const GURL source_url,
const std::string& extension_id,
+ TaskType task_type,
const std::string& action_id);
// Same as ExecuteAndNotify, but no notification is performed.

Powered by Google App Engine
This is Rietveld 408576698