Index: chrome/browser/geolocation/geolocation_content_settings_map.h |
diff --git a/chrome/browser/geolocation/geolocation_content_settings_map.h b/chrome/browser/geolocation/geolocation_content_settings_map.h |
index ae560449335104e6175ec60f2de8af66f9754f3e..033df488c70c875711dd72d26fd9136dea5506f5 100644 |
--- a/chrome/browser/geolocation/geolocation_content_settings_map.h |
+++ b/chrome/browser/geolocation/geolocation_content_settings_map.h |
@@ -17,15 +17,20 @@ |
#include "base/basictypes.h" |
#include "base/ref_counted.h" |
+#include "chrome/browser/prefs/pref_change_registrar.h" |
#include "chrome/common/content_settings.h" |
+#include "chrome/common/notification_observer.h" |
+#include "chrome/common/notification_registrar.h" |
#include "googleurl/src/gurl.h" |
+class ContentSettingsDetails; |
class DictionaryValue; |
class PrefService; |
class Profile; |
class GeolocationContentSettingsMap |
- : public base::RefCountedThreadSafe<GeolocationContentSettingsMap> { |
+ : public base::RefCountedThreadSafe<GeolocationContentSettingsMap>, |
+ public NotificationObserver { |
public: |
typedef std::map<GURL, ContentSetting> OneOriginSettings; |
typedef std::map<GURL, OneOriginSettings> AllOriginsSettings; |
@@ -39,6 +44,9 @@ class GeolocationContentSettingsMap |
// This should only be called on the UI thread. |
ContentSetting GetDefaultContentSetting() const; |
+ // Returns true if the content setting is managed (set by a policy). |
+ bool IsDefaultContentSettingManaged() const; |
+ |
// Returns a single ContentSetting which applies to the given |requesting_url| |
// when embedded in a top-level page from |embedding_url|. To determine the |
// setting for a top-level page, as opposed to a frame embedded in a page, |
@@ -80,12 +88,22 @@ class GeolocationContentSettingsMap |
// This should only be called on the UI thread. |
void ResetToDefault(); |
+ // NotificationObserver implementation. |
+ virtual void Observe(NotificationType type, |
+ const NotificationSource& source, |
+ const NotificationDetails& details); |
+ |
private: |
friend class base::RefCountedThreadSafe<GeolocationContentSettingsMap>; |
// The default setting. |
static const ContentSetting kDefaultSetting; |
+ // Sends a CONTENT_SETTINGS_CHANGED notification. |
+ void NotifyObservers(const ContentSettingsDetails& details); |
+ |
+ void UnregisterObservers(); |
+ |
~GeolocationContentSettingsMap(); |
// Sets the fields of |one_origin_settings| based on the values in |
@@ -97,6 +115,12 @@ class GeolocationContentSettingsMap |
// The profile we're associated with. |
Profile* profile_; |
+ // Registrar to register for PREF_CHANGED notifications. |
+ PrefChangeRegistrar prefs_registrar_; |
+ NotificationRegistrar notification_registrar_; |
+ |
+ bool updating_preferences_; |
jochen (gone - plz use gerrit)
2010/12/08 14:57:43
in this map, you don't need this, since you only s
markusheintz_
2010/12/09 14:27:01
removed again
|
+ |
DISALLOW_COPY_AND_ASSIGN(GeolocationContentSettingsMap); |
}; |