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

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

Issue 246653003: Settings Overides -- warn user when extensions override their NTP. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Polish Created 6 years, 8 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
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 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
70 70
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 81
81 // Indicates whether the external extension was installed during the first 82 // Indicates whether the external extension was installed during the first
82 // run of this profile. 83 // run of this profile.
83 const char kPrefExternalInstallFirstRun[] = "external_first_run"; 84 const char kPrefExternalInstallFirstRun[] = "external_first_run";
84 85
85 // Indicates whether to show an install warning when the user enables. 86 // Indicates whether to show an install warning when the user enables.
86 const char kExtensionDidEscalatePermissions[] = "install_warning_on_enable"; 87 const char kExtensionDidEscalatePermissions[] = "install_warning_on_enable";
87 88
88 // DO NOT USE, use kPrefDisableReasons instead. 89 // DO NOT USE, use kPrefDisableReasons instead.
89 // Indicates whether the extension was updated while it was disabled. 90 // Indicates whether the extension was updated while it was disabled.
(...skipping 650 matching lines...) Expand 10 before | Expand all | Expand 10 after
740 } 741 }
741 742
742 void ExtensionPrefs::SetSettingsApiBubbleBeenAcknowledged( 743 void ExtensionPrefs::SetSettingsApiBubbleBeenAcknowledged(
743 const std::string& extension_id, 744 const std::string& extension_id,
744 bool value) { 745 bool value) {
745 UpdateExtensionPref(extension_id, 746 UpdateExtensionPref(extension_id,
746 kPrefSettingsBubbleAcknowledged, 747 kPrefSettingsBubbleAcknowledged,
747 value ? base::Value::CreateBooleanValue(value) : NULL); 748 value ? base::Value::CreateBooleanValue(value) : NULL);
748 } 749 }
749 750
751 bool ExtensionPrefs::HasNtpControlledBubbleBeenAcknowledged(
752 const std::string& extension_id) {
753 return ReadPrefAsBooleanAndReturn(extension_id, kPrefNtpBubbleAcknowledged);
754 }
755
756 void ExtensionPrefs::SetNtpControlledBubbleBeenAcknowledged(
757 const std::string& extension_id,
758 bool value) {
759 UpdateExtensionPref(extension_id,
760 kPrefNtpBubbleAcknowledged,
761 value ? base::Value::CreateBooleanValue(value) : NULL);
762 }
763
750 bool ExtensionPrefs::SetAlertSystemFirstRun() { 764 bool ExtensionPrefs::SetAlertSystemFirstRun() {
751 if (prefs_->GetBoolean(pref_names::kAlertsInitialized)) { 765 if (prefs_->GetBoolean(pref_names::kAlertsInitialized)) {
752 return true; 766 return true;
753 } 767 }
754 prefs_->SetBoolean(pref_names::kAlertsInitialized, true); 768 prefs_->SetBoolean(pref_names::kAlertsInitialized, true);
755 return false; 769 return false;
756 } 770 }
757 771
758 bool ExtensionPrefs::ExtensionsBlacklistedByDefault() const { 772 bool ExtensionPrefs::ExtensionsBlacklistedByDefault() const {
759 return admin_policy::BlacklistedByDefault( 773 return admin_policy::BlacklistedByDefault(
(...skipping 1460 matching lines...) Expand 10 before | Expand all | Expand 10 after
2220 extension_pref_value_map_->RegisterExtension( 2234 extension_pref_value_map_->RegisterExtension(
2221 extension_id, install_time, is_enabled, is_incognito_enabled); 2235 extension_id, install_time, is_enabled, is_incognito_enabled);
2222 2236
2223 FOR_EACH_OBSERVER( 2237 FOR_EACH_OBSERVER(
2224 ExtensionPrefsObserver, 2238 ExtensionPrefsObserver,
2225 observer_list_, 2239 observer_list_,
2226 OnExtensionRegistered(extension_id, install_time, is_enabled)); 2240 OnExtensionRegistered(extension_id, install_time, is_enabled));
2227 } 2241 }
2228 2242
2229 } // namespace extensions 2243 } // namespace extensions
OLDNEW
« extensions/browser/extension_prefs.h ('K') | « extensions/browser/extension_prefs.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698