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

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: fixed nits 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
« no previous file with comments | « chrome/browser/extensions/extension_prefs.h ('k') | chrome/browser/extensions/extension_service.h » ('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 ebe337cc0b60403f3c82af43d9fae8d2f6495a9b..7fa8136a2d7b09748b20b1680b01b23566e81bf2 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::GetAppNotificationClientId(
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(
« no previous file with comments | « chrome/browser/extensions/extension_prefs.h ('k') | chrome/browser/extensions/extension_service.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698