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); |