diff options
author | bulach@chromium.org <bulach@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-05-11 13:28:16 +0000 |
---|---|---|
committer | bulach@chromium.org <bulach@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-05-11 13:28:16 +0000 |
commit | 777a7b66c0a16a8917b29af3ea6d2e440bc5371b (patch) | |
tree | 6a48fb9ecc0355a29405f3b6e0bfd2c455de8849 /chrome/browser/content_setting_image_model.cc | |
parent | 8b4b84eee1eaa6a77c34f66f7278039004657896 (diff) | |
download | chromium_src-777a7b66c0a16a8917b29af3ea6d2e440bc5371b.zip chromium_src-777a7b66c0a16a8917b29af3ea6d2e440bc5371b.tar.gz chromium_src-777a7b66c0a16a8917b29af3ea6d2e440bc5371b.tar.bz2 |
Adds GeolocationSettingsState
TEST=geolocation_settings_state_unittest.cc
Review URL: http://codereview.chromium.org/1540034
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@46911 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/content_setting_image_model.cc')
-rw-r--r-- | chrome/browser/content_setting_image_model.cc | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/chrome/browser/content_setting_image_model.cc b/chrome/browser/content_setting_image_model.cc index 77b2f1a..4745ec0 100644 --- a/chrome/browser/content_setting_image_model.cc +++ b/chrome/browser/content_setting_image_model.cc @@ -73,22 +73,21 @@ void ContentSettingGeolocationImageModel::UpdateFromTabContents( set_visible(false); return; } - const TabContents::GeolocationContentSettings& settings = - tab_contents->geolocation_content_settings(); - if (settings.empty()) { + const GeolocationSettingsState& settings_state = + tab_contents->geolocation_settings_state(); + if (settings_state.state_map().empty()) { set_visible(false); return; } set_visible(true); + unsigned int tab_state_flags = 0; + settings_state.GetDetailedInfo(NULL, &tab_state_flags); // If any embedded site has access the allowed icon takes priority over the // blocked icon. - for (TabContents::GeolocationContentSettings::const_iterator it = - settings.begin(); it != settings.end(); ++it ) { - if (it->second == CONTENT_SETTING_ALLOW) { - set_icon(IDR_GEOLOCATION_ALLOWED_LOCATIONBAR_ICON); - set_tooltip(l10n_util::GetStringUTF8(IDS_GEOLOCATION_ALLOWED_TOOLTIP)); - return; - } + if (tab_state_flags & GeolocationSettingsState::TABSTATE_HAS_ANY_ALLOWED) { + set_icon(IDR_GEOLOCATION_ALLOWED_LOCATIONBAR_ICON); + set_tooltip(l10n_util::GetStringUTF8(IDS_GEOLOCATION_ALLOWED_TOOLTIP)); + return; } set_icon(IDR_GEOLOCATION_DENIED_LOCATIONBAR_ICON); set_tooltip(l10n_util::GetStringUTF8(IDS_GEOLOCATION_BLOCKED_TOOLTIP)); |