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

Unified Diff: chrome/browser/geolocation/geolocation_content_settings_map.h

Issue 5398001: Allow default desktop content settings to be managed via policy (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: " Created 10 years 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 side-by-side diff with in-line comments
Download patch
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..a67f341e49b579b53cc5be705f648a4feda243fa 100644
--- a/chrome/browser/geolocation/geolocation_content_settings_map.h
+++ b/chrome/browser/geolocation/geolocation_content_settings_map.h
@@ -17,7 +17,10 @@
#include "base/basictypes.h"
#include "base/ref_counted.h"
+#include "chrome/browser/content_settings/content_settings_details.h"
jochen (gone - plz use gerrit) 2010/12/07 09:43:52 a forward declaration should be enough
markusheintz_ 2010/12/07 11:46:15 Done.
+#include "chrome/browser/prefs/pref_change_registrar.h"
#include "chrome/common/content_settings.h"
+#include "chrome/common/notification_observer.h"
#include "googleurl/src/gurl.h"
class DictionaryValue;
@@ -25,7 +28,8 @@ 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 +43,9 @@ class GeolocationContentSettingsMap
// This should only be called on the UI thread.
ContentSetting GetDefaultContentSetting() const;
+ // Returns whether the content setting is managed (set by a policy).
jochen (gone - plz use gerrit) 2010/12/07 09:43:52 True if ...
markusheintz_ 2010/12/07 11:46:15 True if the content setting is managed.
+ 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 +87,20 @@ 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);
+
~GeolocationContentSettingsMap();
// Sets the fields of |one_origin_settings| based on the values in
@@ -97,6 +112,9 @@ class GeolocationContentSettingsMap
// The profile we're associated with.
Profile* profile_;
+ //
jochen (gone - plz use gerrit) 2010/12/07 09:43:52 comment?
markusheintz_ 2010/12/07 11:46:15 sry. Added a comment.
+ PrefChangeRegistrar prefs_registrar_;
+
DISALLOW_COPY_AND_ASSIGN(GeolocationContentSettingsMap);
};

Powered by Google App Engine
This is Rietveld 408576698