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

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

Issue 320633002: Add an extension override bubble and warning box for proxy extensions. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 6 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 | Annotate | Revision Log
« no previous file with comments | « extensions/browser/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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "extensions/browser/extension_prefs.h" 5 #include "extensions/browser/extension_prefs.h"
6 6
7 #include <iterator> 7 #include <iterator>
8 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/prefs/pref_notifier.h" 10 #include "base/prefs/pref_notifier.h"
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
71 // The count of how many times we prompted the user to acknowledge an 71 // The count of how many times we prompted the user to acknowledge an
72 // extension. 72 // extension.
73 const char kPrefAcknowledgePromptCount[] = "ack_prompt_count"; 73 const char kPrefAcknowledgePromptCount[] = "ack_prompt_count";
74 74
75 // Indicates whether the user has acknowledged various types of extensions. 75 // Indicates whether the user has acknowledged various types of extensions.
76 const char kPrefExternalAcknowledged[] = "ack_external"; 76 const char kPrefExternalAcknowledged[] = "ack_external";
77 const char kPrefBlacklistAcknowledged[] = "ack_blacklist"; 77 const char kPrefBlacklistAcknowledged[] = "ack_blacklist";
78 const char kPrefWipeoutAcknowledged[] = "ack_wiped"; 78 const char kPrefWipeoutAcknowledged[] = "ack_wiped";
79 const char kPrefSettingsBubbleAcknowledged[] = "ack_settings_bubble"; 79 const char kPrefSettingsBubbleAcknowledged[] = "ack_settings_bubble";
80 const char kPrefNtpBubbleAcknowledged[] = "ack_ntp_bubble"; 80 const char kPrefNtpBubbleAcknowledged[] = "ack_ntp_bubble";
81 const char kPrefProxyBubbleAcknowledged[] = "ack_proxy_bubble";
81 82
82 // Indicates whether the external extension was installed during the first 83 // Indicates whether the external extension was installed during the first
83 // run of this profile. 84 // run of this profile.
84 const char kPrefExternalInstallFirstRun[] = "external_first_run"; 85 const char kPrefExternalInstallFirstRun[] = "external_first_run";
85 86
86 // Indicates whether to show an install warning when the user enables. 87 // Indicates whether to show an install warning when the user enables.
87 const char kExtensionDidEscalatePermissions[] = "install_warning_on_enable"; 88 const char kExtensionDidEscalatePermissions[] = "install_warning_on_enable";
88 89
89 // DO NOT USE, use kPrefDisableReasons instead. 90 // DO NOT USE, use kPrefDisableReasons instead.
90 // Indicates whether the extension was updated while it was disabled. 91 // Indicates whether the extension was updated while it was disabled.
(...skipping 657 matching lines...) Expand 10 before | Expand all | Expand 10 after
748 } 749 }
749 750
750 void ExtensionPrefs::SetNtpOverriddenBubbleBeenAcknowledged( 751 void ExtensionPrefs::SetNtpOverriddenBubbleBeenAcknowledged(
751 const std::string& extension_id, 752 const std::string& extension_id,
752 bool value) { 753 bool value) {
753 UpdateExtensionPref(extension_id, 754 UpdateExtensionPref(extension_id,
754 kPrefNtpBubbleAcknowledged, 755 kPrefNtpBubbleAcknowledged,
755 value ? base::Value::CreateBooleanValue(value) : NULL); 756 value ? base::Value::CreateBooleanValue(value) : NULL);
756 } 757 }
757 758
759 bool ExtensionPrefs::HasProxyOverriddenBubbleBeenAcknowledged(
760 const std::string& extension_id) {
761 return ReadPrefAsBooleanAndReturn(extension_id, kPrefProxyBubbleAcknowledged);
762 }
763
764 void ExtensionPrefs::SetProxyOverriddenBubbleBeenAcknowledged(
765 const std::string& extension_id,
766 bool value) {
767 UpdateExtensionPref(extension_id,
768 kPrefProxyBubbleAcknowledged,
769 value ? base::Value::CreateBooleanValue(value) : NULL);
770 }
771
758 bool ExtensionPrefs::SetAlertSystemFirstRun() { 772 bool ExtensionPrefs::SetAlertSystemFirstRun() {
759 if (prefs_->GetBoolean(pref_names::kAlertsInitialized)) { 773 if (prefs_->GetBoolean(pref_names::kAlertsInitialized)) {
760 return true; 774 return true;
761 } 775 }
762 prefs_->SetBoolean(pref_names::kAlertsInitialized, true); 776 prefs_->SetBoolean(pref_names::kAlertsInitialized, true);
763 return false; 777 return false;
764 } 778 }
765 779
766 bool ExtensionPrefs::ExtensionsBlacklistedByDefault() const { 780 bool ExtensionPrefs::ExtensionsBlacklistedByDefault() const {
767 return admin_policy::BlacklistedByDefault( 781 return admin_policy::BlacklistedByDefault(
(...skipping 1446 matching lines...) Expand 10 before | Expand all | Expand 10 after
2214 extension_pref_value_map_->RegisterExtension( 2228 extension_pref_value_map_->RegisterExtension(
2215 extension_id, install_time, is_enabled, is_incognito_enabled); 2229 extension_id, install_time, is_enabled, is_incognito_enabled);
2216 2230
2217 FOR_EACH_OBSERVER( 2231 FOR_EACH_OBSERVER(
2218 ExtensionPrefsObserver, 2232 ExtensionPrefsObserver,
2219 observer_list_, 2233 observer_list_,
2220 OnExtensionRegistered(extension_id, install_time, is_enabled)); 2234 OnExtensionRegistered(extension_id, install_time, is_enabled));
2221 } 2235 }
2222 2236
2223 } // namespace extensions 2237 } // namespace extensions
OLDNEW
« no previous file with comments | « extensions/browser/extension_prefs.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698