summaryrefslogtreecommitdiffstats
path: root/chrome/browser/ui
diff options
context:
space:
mode:
authormarkusheintz@chromium.org <markusheintz@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-07-19 14:50:08 +0000
committermarkusheintz@chromium.org <markusheintz@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-07-19 14:50:08 +0000
commit3c2e12d927c4bb559bd4eb3824c4e1fa43a44baf (patch)
tree5bbac630f80f7137783e6e771802c06731887491 /chrome/browser/ui
parent964361c7ca8d3db84751130de8825550fcfd5025 (diff)
downloadchromium_src-3c2e12d927c4bb559bd4eb3824c4e1fa43a44baf.zip
chromium_src-3c2e12d927c4bb559bd4eb3824c4e1fa43a44baf.tar.gz
chromium_src-3c2e12d927c4bb559bd4eb3824c4e1fa43a44baf.tar.bz2
Migrate default geolocation content setting to host content settings map.
BUG=TODO TEST=geolocation_content_settings_map_unittest.cc, content_settings_pref_provider_unittest.cc, host_content_settings_map_unittest.cc Review URL: http://codereview.chromium.org/7328018 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@93018 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/ui')
-rw-r--r--chrome/browser/ui/content_settings/content_setting_bubble_model_unittest.cc6
-rw-r--r--chrome/browser/ui/webui/options/content_settings_handler.cc23
2 files changed, 10 insertions, 19 deletions
diff --git a/chrome/browser/ui/content_settings/content_setting_bubble_model_unittest.cc b/chrome/browser/ui/content_settings/content_setting_bubble_model_unittest.cc
index 65e2c0f..01b2ebf 100644
--- a/chrome/browser/ui/content_settings/content_setting_bubble_model_unittest.cc
+++ b/chrome/browser/ui/content_settings/content_setting_bubble_model_unittest.cc
@@ -190,7 +190,8 @@ TEST_F(ContentSettingBubbleModelTest, Geolocation) {
CheckGeolocationBubble(1, true, false);
// Change the default to allow: no message needed.
- setting_map->SetDefaultContentSetting(CONTENT_SETTING_ALLOW);
+ profile_->GetHostContentSettingsMap()->SetDefaultContentSetting(
+ CONTENT_SETTINGS_TYPE_GEOLOCATION, CONTENT_SETTING_ALLOW);
CheckGeolocationBubble(1, false, false);
// Second frame denied, but not stored in the content map: requires reload.
@@ -198,7 +199,8 @@ TEST_F(ContentSettingBubbleModelTest, Geolocation) {
CheckGeolocationBubble(2, false, true);
// Change the default to block: offer a clear link for the persisted frame 1.
- setting_map->SetDefaultContentSetting(CONTENT_SETTING_BLOCK);
+ profile_->GetHostContentSettingsMap()->SetDefaultContentSetting(
+ CONTENT_SETTINGS_TYPE_GEOLOCATION, CONTENT_SETTING_BLOCK);
CheckGeolocationBubble(2, true, false);
}
diff --git a/chrome/browser/ui/webui/options/content_settings_handler.cc b/chrome/browser/ui/webui/options/content_settings_handler.cc
index ccb51dc..cb4b0b6 100644
--- a/chrome/browser/ui/webui/options/content_settings_handler.cc
+++ b/chrome/browser/ui/webui/options/content_settings_handler.cc
@@ -292,7 +292,6 @@ void ContentSettingsHandler::Initialize() {
PrefService* prefs = web_ui_->GetProfile()->GetPrefs();
pref_change_registrar_.Init(prefs);
- pref_change_registrar_.Add(prefs::kGeolocationDefaultContentSetting, this);
pref_change_registrar_.Add(prefs::kGeolocationContentSettings, this);
}
@@ -328,9 +327,7 @@ void ContentSettingsHandler::Observe(int type,
case chrome::NOTIFICATION_PREF_CHANGED: {
const std::string& pref_name = *Details<std::string>(details).ptr();
- if (pref_name == prefs::kGeolocationDefaultContentSetting)
- UpdateSettingDefaultFromModel(CONTENT_SETTINGS_TYPE_GEOLOCATION);
- else if (pref_name == prefs::kGeolocationContentSettings)
+ if (pref_name == prefs::kGeolocationContentSettings)
UpdateGeolocationExceptionsView();
break;
}
@@ -370,14 +367,12 @@ void ContentSettingsHandler::UpdateSettingDefaultFromModel(
std::string ContentSettingsHandler::GetSettingDefaultFromModel(
ContentSettingsType type) {
ContentSetting default_setting;
- if (type == CONTENT_SETTINGS_TYPE_GEOLOCATION) {
- default_setting = web_ui_->GetProfile()->
- GetGeolocationContentSettingsMap()->GetDefaultContentSetting();
- } else if (type == CONTENT_SETTINGS_TYPE_NOTIFICATIONS) {
+ if (type == CONTENT_SETTINGS_TYPE_NOTIFICATIONS) {
default_setting = DesktopNotificationServiceFactory::GetForProfile(
web_ui_->GetProfile())->GetDefaultContentSetting();
} else {
- default_setting = GetContentSettingsMap()->GetDefaultContentSetting(type);
+ default_setting = web_ui_->GetProfile()->
+ GetHostContentSettingsMap()->GetDefaultContentSetting(type);
}
return ContentSettingToString(default_setting);
@@ -385,10 +380,7 @@ std::string ContentSettingsHandler::GetSettingDefaultFromModel(
bool ContentSettingsHandler::GetDefaultSettingManagedFromModel(
ContentSettingsType type) {
- if (type == CONTENT_SETTINGS_TYPE_GEOLOCATION) {
- return web_ui_->GetProfile()->
- GetGeolocationContentSettingsMap()->IsDefaultContentSettingManaged();
- } else if (type == CONTENT_SETTINGS_TYPE_NOTIFICATIONS) {
+ if (type == CONTENT_SETTINGS_TYPE_NOTIFICATIONS) {
return DesktopNotificationServiceFactory::GetForProfile(
web_ui_->GetProfile())->IsDefaultContentSettingManaged();
} else {
@@ -587,10 +579,7 @@ void ContentSettingsHandler::SetContentFilter(const ListValue* args) {
ContentSetting default_setting = ContentSettingFromString(setting);
ContentSettingsType content_type = ContentSettingsTypeFromGroupName(group);
- if (content_type == CONTENT_SETTINGS_TYPE_GEOLOCATION) {
- web_ui_->GetProfile()->GetGeolocationContentSettingsMap()->
- SetDefaultContentSetting(default_setting);
- } else if (content_type == CONTENT_SETTINGS_TYPE_NOTIFICATIONS) {
+ if (content_type == CONTENT_SETTINGS_TYPE_NOTIFICATIONS) {
DesktopNotificationServiceFactory::GetForProfile(web_ui_->GetProfile())->
SetDefaultContentSetting(default_setting);
} else {