summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorallanwoj@chromium.org <allanwoj@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-09-02 16:13:14 +0000
committerallanwoj@chromium.org <allanwoj@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-09-02 16:13:14 +0000
commit4f8452d18c71301f141795eb95a9c2e0a8358aaf (patch)
treeb98572783a0f2fad72a8945f12d7bb438af0eee0
parent0f873e8291deea212112dc7d6b48b0f0450522c2 (diff)
downloadchromium_src-4f8452d18c71301f141795eb95a9c2e0a8358aaf.zip
chromium_src-4f8452d18c71301f141795eb95a9c2e0a8358aaf.tar.gz
chromium_src-4f8452d18c71301f141795eb95a9c2e0a8358aaf.tar.bz2
Fix geolocation icon behaviour on navigation
Now clears the allowed/not allowed geolocation statemap at the beginning of a navigation in a similar way for cookies as done in this CL http://codereview.chromium.org/3194005 Before the icon would hang around after navigation until a tab contents update occurred. BUG=53339 TEST=Start up geolocation on a website then navigate away. Review URL: http://codereview.chromium.org/3305004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@58364 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/browser/geolocation/geolocation_settings_state.cc4
-rw-r--r--chrome/browser/geolocation/geolocation_settings_state.h2
-rw-r--r--chrome/browser/tab_contents/tab_contents.cc4
-rw-r--r--chrome/browser/tab_contents/tab_specific_content_settings.cc4
-rw-r--r--chrome/browser/tab_contents/tab_specific_content_settings.h3
5 files changed, 16 insertions, 1 deletions
diff --git a/chrome/browser/geolocation/geolocation_settings_state.cc b/chrome/browser/geolocation/geolocation_settings_state.cc
index fa9b172..5c7b784 100644
--- a/chrome/browser/geolocation/geolocation_settings_state.cc
+++ b/chrome/browser/geolocation/geolocation_settings_state.cc
@@ -44,6 +44,10 @@ void GeolocationSettingsState::DidNavigate(
state_map_.clear();
}
+void GeolocationSettingsState::ClearStateMap() {
+ state_map_.clear();
+}
+
void GeolocationSettingsState::GetDetailedInfo(
FormattedHostsPerState* formatted_hosts_per_state,
unsigned int* tab_state_flags) const {
diff --git a/chrome/browser/geolocation/geolocation_settings_state.h b/chrome/browser/geolocation/geolocation_settings_state.h
index 86a5c26..97e5468 100644
--- a/chrome/browser/geolocation/geolocation_settings_state.h
+++ b/chrome/browser/geolocation/geolocation_settings_state.h
@@ -33,6 +33,8 @@ class GeolocationSettingsState {
// may need to clear our settings.
void DidNavigate(const NavigationController::LoadCommittedDetails& details);
+ void ClearStateMap();
+
enum TabState {
TABSTATE_NONE = 0,
// There's at least one entry with non-default setting.
diff --git a/chrome/browser/tab_contents/tab_contents.cc b/chrome/browser/tab_contents/tab_contents.cc
index 657c464..542a567 100644
--- a/chrome/browser/tab_contents/tab_contents.cc
+++ b/chrome/browser/tab_contents/tab_contents.cc
@@ -2104,8 +2104,10 @@ void TabContents::DidStartProvisionalLoadForFrame(
NotificationType::FRAME_PROVISIONAL_LOAD_START,
Source<NavigationController>(&controller_),
Details<ProvisionalLoadDetails>(&details));
- if (is_main_frame)
+ if (is_main_frame) {
content_settings_delegate_->ClearCookieSpecificContentSettings();
+ content_settings_delegate_->ClearGeolocationContentSettings();
+ }
}
void TabContents::DidStartReceivingResourceResponse(
diff --git a/chrome/browser/tab_contents/tab_specific_content_settings.cc b/chrome/browser/tab_contents/tab_specific_content_settings.cc
index 8a2312f..066b239 100644
--- a/chrome/browser/tab_contents/tab_specific_content_settings.cc
+++ b/chrome/browser/tab_contents/tab_specific_content_settings.cc
@@ -205,6 +205,10 @@ void TabSpecificContentSettings::GeolocationDidNavigate(
geolocation_settings_state_.DidNavigate(details);
}
+void TabSpecificContentSettings::ClearGeolocationContentSettings() {
+ geolocation_settings_state_.ClearStateMap();
+}
+
CookiesTreeModel* TabSpecificContentSettings::GetAllowedCookiesTreeModel() {
return allowed_local_shared_objects_.GetCookiesTreeModel();
}
diff --git a/chrome/browser/tab_contents/tab_specific_content_settings.h b/chrome/browser/tab_contents/tab_specific_content_settings.h
index ce104b4..350033e 100644
--- a/chrome/browser/tab_contents/tab_specific_content_settings.h
+++ b/chrome/browser/tab_contents/tab_specific_content_settings.h
@@ -49,6 +49,9 @@ class TabSpecificContentSettings
// Resets all cookies related information.
void ClearCookieSpecificContentSettings();
+ // Clears the Geolocation settings.
+ void ClearGeolocationContentSettings();
+
// Changes the |content_blocked_| entry for popups.
void SetPopupsBlocked(bool blocked);