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

Side by Side Diff: chrome/browser/extensions/extension_prefs.cc

Issue 14858037: Move [Get|Set]WebStoreLogin methods from ExtensionPrefs to WebstorePrivateAPI (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Latest master for CQ Created 7 years, 7 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 unified diff | Download patch
« no previous file with comments | « chrome/browser/extensions/extension_prefs.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/extensions/extension_prefs.h" 5 #include "chrome/browser/extensions/extension_prefs.h"
6 6
7 #include "base/prefs/pref_notifier.h" 7 #include "base/prefs/pref_notifier.h"
8 #include "base/prefs/pref_service.h" 8 #include "base/prefs/pref_service.h"
9 #include "base/string_util.h" 9 #include "base/string_util.h"
10 #include "base/strings/string_number_conversions.h" 10 #include "base/strings/string_number_conversions.h"
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after
121 const char kPrefIncognitoEnabled[] = "incognito"; 121 const char kPrefIncognitoEnabled[] = "incognito";
122 122
123 // A preference to control whether an extension is allowed to inject script in 123 // A preference to control whether an extension is allowed to inject script in
124 // pages with file URLs. 124 // pages with file URLs.
125 const char kPrefAllowFileAccess[] = "newAllowFileAccess"; 125 const char kPrefAllowFileAccess[] = "newAllowFileAccess";
126 // TODO(jstritar): As part of fixing http://crbug.com/91577, we revoked all 126 // TODO(jstritar): As part of fixing http://crbug.com/91577, we revoked all
127 // extension file access by renaming the pref. We should eventually clean up 127 // extension file access by renaming the pref. We should eventually clean up
128 // the old flag and possibly go back to that name. 128 // the old flag and possibly go back to that name.
129 // const char kPrefAllowFileAccessOld[] = "allowFileAccess"; 129 // const char kPrefAllowFileAccessOld[] = "allowFileAccess";
130 130
131 // A preference set by the web store to indicate login information for
132 // purchased apps.
133 const char kWebStoreLogin[] = "extensions.webstore_login";
134
135 // A preference set by the the NTP to persist the desired launch container type 131 // A preference set by the the NTP to persist the desired launch container type
136 // used for apps. 132 // used for apps.
137 const char kPrefLaunchType[] = "launchType"; 133 const char kPrefLaunchType[] = "launchType";
138 134
139 // A preference specifying if the user dragged the app on the NTP. 135 // A preference specifying if the user dragged the app on the NTP.
140 const char kPrefUserDraggedApp[] = "user_dragged_app_ntp"; 136 const char kPrefUserDraggedApp[] = "user_dragged_app_ntp";
141 137
142 // Preferences that hold which permissions the user has granted the extension. 138 // Preferences that hold which permissions the user has granted the extension.
143 // We explicitly keep track of these so that extensions can contain unknown 139 // We explicitly keep track of these so that extensions can contain unknown
144 // permissions, for backwards compatibility reasons, and we can still prompt 140 // permissions, for backwards compatibility reasons, and we can still prompt
(...skipping 1336 matching lines...) Expand 10 before | Expand all | Expand 10 after
1481 continue; 1477 continue;
1482 1478
1483 scoped_ptr<ExtensionInfo> info = GetDelayedInstallInfo(extension_id.key()); 1479 scoped_ptr<ExtensionInfo> info = GetDelayedInstallInfo(extension_id.key());
1484 if (info) 1480 if (info)
1485 extensions_info->push_back(linked_ptr<ExtensionInfo>(info.release())); 1481 extensions_info->push_back(linked_ptr<ExtensionInfo>(info.release()));
1486 } 1482 }
1487 1483
1488 return extensions_info.Pass(); 1484 return extensions_info.Pass();
1489 } 1485 }
1490 1486
1491 bool ExtensionPrefs::GetWebStoreLogin(std::string* result) {
1492 if (prefs_->HasPrefPath(kWebStoreLogin)) {
1493 *result = prefs_->GetString(kWebStoreLogin);
1494 return true;
1495 }
1496 return false;
1497 }
1498
1499 void ExtensionPrefs::SetWebStoreLogin(const std::string& login) {
1500 prefs_->SetString(kWebStoreLogin, login);
1501 }
1502
1503 bool ExtensionPrefs::WasAppDraggedByUser(const std::string& extension_id) { 1487 bool ExtensionPrefs::WasAppDraggedByUser(const std::string& extension_id) {
1504 return ReadPrefAsBooleanAndReturn(extension_id, kPrefUserDraggedApp); 1488 return ReadPrefAsBooleanAndReturn(extension_id, kPrefUserDraggedApp);
1505 } 1489 }
1506 1490
1507 void ExtensionPrefs::SetAppDraggedByUser(const std::string& extension_id) { 1491 void ExtensionPrefs::SetAppDraggedByUser(const std::string& extension_id) {
1508 UpdateExtensionPref(extension_id, kPrefUserDraggedApp, 1492 UpdateExtensionPref(extension_id, kPrefUserDraggedApp,
1509 Value::CreateBooleanValue(true)); 1493 Value::CreateBooleanValue(true));
1510 } 1494 }
1511 1495
1512 void ExtensionPrefs::OnContentSettingChanged( 1496 void ExtensionPrefs::OnContentSettingChanged(
(...skipping 407 matching lines...) Expand 10 before | Expand all | Expand 10 after
1920 registry->RegisterListPref(prefs::kExtensionInstallAllowList, 1904 registry->RegisterListPref(prefs::kExtensionInstallAllowList,
1921 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); 1905 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF);
1922 registry->RegisterListPref(prefs::kExtensionInstallDenyList, 1906 registry->RegisterListPref(prefs::kExtensionInstallDenyList,
1923 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); 1907 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF);
1924 registry->RegisterDictionaryPref( 1908 registry->RegisterDictionaryPref(
1925 prefs::kExtensionInstallForceList, 1909 prefs::kExtensionInstallForceList,
1926 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); 1910 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF);
1927 registry->RegisterListPref(prefs::kExtensionAllowedTypes, 1911 registry->RegisterListPref(prefs::kExtensionAllowedTypes,
1928 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); 1912 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF);
1929 registry->RegisterStringPref( 1913 registry->RegisterStringPref(
1930 kWebStoreLogin,
1931 std::string(), // default value
1932 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF);
1933 registry->RegisterStringPref(
1934 prefs::kExtensionBlacklistUpdateVersion, 1914 prefs::kExtensionBlacklistUpdateVersion,
1935 "0", // default value 1915 "0", // default value
1936 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); 1916 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF);
1937 registry->RegisterBooleanPref( 1917 registry->RegisterBooleanPref(
1938 prefs::kExtensionStorageGarbageCollect, 1918 prefs::kExtensionStorageGarbageCollect,
1939 false, // default value 1919 false, // default value
1940 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); 1920 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF);
1941 registry->RegisterInt64Pref( 1921 registry->RegisterInt64Pref(
1942 prefs::kLastExtensionsUpdateCheck, 1922 prefs::kLastExtensionsUpdateCheck,
1943 0, // default value 1923 0, // default value
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after
2060 is_enabled = initial_state == Extension::ENABLED; 2040 is_enabled = initial_state == Extension::ENABLED;
2061 } 2041 }
2062 2042
2063 extension_pref_value_map_->RegisterExtension(extension_id, install_time, 2043 extension_pref_value_map_->RegisterExtension(extension_id, install_time,
2064 is_enabled); 2044 is_enabled);
2065 content_settings_store_->RegisterExtension(extension_id, install_time, 2045 content_settings_store_->RegisterExtension(extension_id, install_time,
2066 is_enabled); 2046 is_enabled);
2067 } 2047 }
2068 2048
2069 } // namespace extensions 2049 } // namespace extensions
OLDNEW
« no previous file with comments | « chrome/browser/extensions/extension_prefs.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698