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

Unified Diff: chrome/browser/extensions/extension_prefs.cc

Issue 6543017: Track which apps the user has re-ordered on the NTP. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix presubmit check Created 9 years, 10 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
« no previous file with comments | « chrome/browser/extensions/extension_prefs.h ('k') | chrome/browser/extensions/extension_prefs_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/extension_prefs.cc
diff --git a/chrome/browser/extensions/extension_prefs.cc b/chrome/browser/extensions/extension_prefs.cc
index c358dd6b2290880dd5aafd18617d55e5c70e6ca8..4a4c40f0d9d821ef8b28aeb2b0d8ec1276f14377 100644
--- a/chrome/browser/extensions/extension_prefs.cc
+++ b/chrome/browser/extensions/extension_prefs.cc
@@ -79,6 +79,9 @@ const char kPrefLaunchType[] = "launchType";
// A preference determining the order of which the apps appear on the NTP.
const char kPrefAppLaunchIndex[] = "app_launcher_index";
+// A preference specifying if the user dragged the app on the NTP.
+const char kPrefUserDraggedApp[] = "user_dragged_app_ntp";
+
// A preference for storing extra data sent in update checks for an extension.
const char kUpdateUrlData[] = "update_url_data";
@@ -1126,6 +1129,27 @@ void ExtensionPrefs::SetAppLauncherOrder(
NotificationService::NoDetails());
}
+bool ExtensionPrefs::WasAppDraggedByUser(const std::string& extension_id) {
+ DictionaryValue* dictionary = GetExtensionPref(extension_id);
+ if (!dictionary) {
+ NOTREACHED();
+ return false;
+ }
+
+ return ReadBooleanFromPref(dictionary, kPrefUserDraggedApp);
+}
+
+void ExtensionPrefs::SetAppDraggedByUser(const std::string& extension_id) {
+ DictionaryValue* dictionary = GetExtensionPref(extension_id);
+ if (!dictionary) {
+ NOTREACHED();
+ return;
+ }
+
+ dictionary->SetBoolean(kPrefUserDraggedApp, true);
+ SavePrefsAndNotify();
+}
+
void ExtensionPrefs::SetUpdateUrlData(const std::string& extension_id,
const std::string& data) {
DictionaryValue* dictionary = GetExtensionPref(extension_id);
« no previous file with comments | « chrome/browser/extensions/extension_prefs.h ('k') | chrome/browser/extensions/extension_prefs_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698