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

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

Issue 8727024: Save the oauth client id used in App Notification setup (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 1 month 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/extensions/extension_prefs.cc
diff --git a/chrome/browser/extensions/extension_prefs.cc b/chrome/browser/extensions/extension_prefs.cc
index ebe337cc0b60403f3c82af43d9fae8d2f6495a9b..2068136692839cc845f0b693e951bffd0b7768f7 100644
--- a/chrome/browser/extensions/extension_prefs.cc
+++ b/chrome/browser/extensions/extension_prefs.cc
@@ -45,8 +45,8 @@ const char kPrefVersion[] = "manifest.version";
// Indicates whether an extension is blacklisted.
const char kPrefBlacklist[] = "blacklist";
-// Indicates whether the user has done app notifications setup or not.
-const char kPrefAppNotificationSetup[] = "app_notif_setup";
+// The oauth client id used for app notification setup.
+const char kPrefAppNotificationClientId[] = "app_notif_client_id";
// Indicates whether the user has disabled notifications or not.
const char kPrefAppNotificationDisbaled[] = "app_notif_disabled";
@@ -592,18 +592,23 @@ bool ExtensionPrefs::SetAlertSystemFirstRun() {
return false;
}
-bool ExtensionPrefs::IsAppNotificationSetupDone(
+std::string ExtensionPrefs::AppNotificationClientId(
Munjal (Google) 2011/11/29 21:55:34 Nit: AppNotificationClientId to GetAppNotification
asargent_no_longer_on_chrome 2011/11/30 06:06:20 Done. I was ambivalent about this when writing t
const std::string& extension_id) const {
- return ReadExtensionPrefBoolean(
- extension_id, kPrefAppNotificationSetup);
+ const DictionaryValue* dict = GetExtensionPref(extension_id);
+ if (!dict || !dict->HasKey(kPrefAppNotificationClientId))
+ return std::string();
+
+ std::string tmp;
+ dict->GetString(kPrefAppNotificationClientId, &tmp);
+ return tmp;
}
-void ExtensionPrefs::SetAppNotificationSetupDone(
+void ExtensionPrefs::SetAppNotificationClientId(
const std::string& extension_id,
- bool value) {
+ const std::string& oauth_client_id) {
DCHECK(Extension::IdIsValid(extension_id));
- UpdateExtensionPref(extension_id, kPrefAppNotificationSetup,
- Value::CreateBooleanValue(value));
+ UpdateExtensionPref(extension_id, kPrefAppNotificationClientId,
+ Value::CreateStringValue(oauth_client_id));
}
bool ExtensionPrefs::IsAppNotificationDisabled(

Powered by Google App Engine
This is Rietveld 408576698