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

Unified Diff: chrome/browser/apps/drive/drive_app_mapping.h

Issue 308003005: app_list: Drive app integration. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: move to c/b/apps, add OWNERS Created 6 years, 6 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/apps/drive/drive_app_mapping.h
diff --git a/chrome/browser/apps/drive/drive_app_mapping.h b/chrome/browser/apps/drive/drive_app_mapping.h
new file mode 100644
index 0000000000000000000000000000000000000000..5f9d68aab71e0b3068682b6241371bf2ec86c20d
--- /dev/null
+++ b/chrome/browser/apps/drive/drive_app_mapping.h
@@ -0,0 +1,46 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROME_BROWSER_APPS_DRIVE_DRIVE_APP_MAPPING_H_
+#define CHROME_BROWSER_APPS_DRIVE_DRIVE_APP_MAPPING_H_
+
+#include <set>
+#include <string>
+
+#include "base/macros.h"
+
+namespace user_prefs {
+class PrefRegistrySyncable;
+}
+
+class PrefService;
+
+namespace extensions {
+
+// DriveAppMapping tracks the mapping between Drive apps and corresponding
+// Chrome apps. The data is backed by kAppLauncherDriveAppMapping pref.
+class DriveAppMapping {
+ public:
+ explicit DriveAppMapping(PrefService* prefs);
+ ~DriveAppMapping();
+
+ static void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry);
+
+ void Add(const std::string& drive_app_id, const std::string& chrome_app_id);
+ void Remove(const std::string& drive_app_id);
+
+ std::string GetChromeApp(const std::string& drive_app_id) const;
+ std::string GetDriveApp(const std::string& chrome_app_id) const;
+
+ std::set<std::string> GetDriveAppIds() const;
+
+ private:
+ PrefService* prefs_;
+
+ DISALLOW_COPY_AND_ASSIGN(DriveAppMapping);
+};
+
+} // namespace extensions
+
+#endif // CHROME_BROWSER_APPS_DRIVE_DRIVE_APP_MAPPING_H_

Powered by Google App Engine
This is Rietveld 408576698