| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 // Maps [requesting_origin, embedder] to content settings. Written on the UI | 5 // Maps [requesting_origin, embedder] to content settings. Written on the UI |
| 6 // thread and read on any thread. One instance per profile. This is based on | 6 // thread and read on any thread. One instance per profile. This is based on |
| 7 // HostContentSettingsMap but differs significantly in two aspects: | 7 // HostContentSettingsMap but differs significantly in two aspects: |
| 8 // - It maps [requesting_origin.GetOrigin(), embedder.GetOrigin()] => setting | 8 // - It maps [requesting_origin.GetOrigin(), embedder.GetOrigin()] => setting |
| 9 // rather than host => setting. | 9 // rather than host => setting. |
| 10 // - It manages only Geolocation. | 10 // - It manages only Geolocation. |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 84 void SetContentSetting(const GURL& requesting_url, | 84 void SetContentSetting(const GURL& requesting_url, |
| 85 const GURL& embedding_url, | 85 const GURL& embedding_url, |
| 86 ContentSetting setting); | 86 ContentSetting setting); |
| 87 | 87 |
| 88 // Resets all settings. | 88 // Resets all settings. |
| 89 // | 89 // |
| 90 // This should only be called on the UI thread. | 90 // This should only be called on the UI thread. |
| 91 void ResetToDefault(); | 91 void ResetToDefault(); |
| 92 | 92 |
| 93 // NotificationObserver implementation. | 93 // NotificationObserver implementation. |
| 94 virtual void Observe(NotificationType type, | 94 virtual void Observe(int type, |
| 95 const NotificationSource& source, | 95 const NotificationSource& source, |
| 96 const NotificationDetails& details); | 96 const NotificationDetails& details); |
| 97 | 97 |
| 98 private: | 98 private: |
| 99 friend class base::RefCountedThreadSafe<GeolocationContentSettingsMap>; | 99 friend class base::RefCountedThreadSafe<GeolocationContentSettingsMap>; |
| 100 | 100 |
| 101 // The default setting. | 101 // The default setting. |
| 102 static const ContentSetting kDefaultSetting; | 102 static const ContentSetting kDefaultSetting; |
| 103 | 103 |
| 104 // Sends a CONTENT_SETTINGS_CHANGED notification. | 104 // Sends a CONTENT_SETTINGS_CHANGED notification. |
| (...skipping 11 matching lines...) Expand all Loading... |
| 116 Profile* profile_; | 116 Profile* profile_; |
| 117 | 117 |
| 118 // Registrar to register for PREF_CHANGED notifications. | 118 // Registrar to register for PREF_CHANGED notifications. |
| 119 PrefChangeRegistrar prefs_registrar_; | 119 PrefChangeRegistrar prefs_registrar_; |
| 120 NotificationRegistrar notification_registrar_; | 120 NotificationRegistrar notification_registrar_; |
| 121 | 121 |
| 122 DISALLOW_COPY_AND_ASSIGN(GeolocationContentSettingsMap); | 122 DISALLOW_COPY_AND_ASSIGN(GeolocationContentSettingsMap); |
| 123 }; | 123 }; |
| 124 | 124 |
| 125 #endif // CHROME_BROWSER_GEOLOCATION_GEOLOCATION_CONTENT_SETTINGS_MAP_H_ | 125 #endif // CHROME_BROWSER_GEOLOCATION_GEOLOCATION_CONTENT_SETTINGS_MAP_H_ |
| OLD | NEW |