| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 #ifndef CHROME_BROWSER_CONTENT_SETTINGS_TAB_SPECIFIC_CONTENT_SETTINGS_H_ | 5 #ifndef CHROME_BROWSER_CONTENT_SETTINGS_TAB_SPECIFIC_CONTENT_SETTINGS_H_ |
| 6 #define CHROME_BROWSER_CONTENT_SETTINGS_TAB_SPECIFIC_CONTENT_SETTINGS_H_ | 6 #define CHROME_BROWSER_CONTENT_SETTINGS_TAB_SPECIFIC_CONTENT_SETTINGS_H_ |
| 7 | 7 |
| 8 #include <set> | 8 #include <set> |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| 11 #include "base/basictypes.h" | 11 #include "base/basictypes.h" |
| 12 #include "base/memory/ref_counted.h" | 12 #include "base/memory/ref_counted.h" |
| 13 #include "base/memory/scoped_ptr.h" | 13 #include "base/memory/scoped_ptr.h" |
| 14 #include "base/observer_list.h" | 14 #include "base/observer_list.h" |
| 15 #include "chrome/browser/content_settings/local_shared_objects_container.h" | 15 #include "chrome/browser/content_settings/local_shared_objects_container.h" |
| 16 #include "chrome/browser/geolocation/geolocation_settings_state.h" | 16 #include "chrome/browser/geolocation/geolocation_settings_state.h" |
| 17 #include "chrome/common/content_settings.h" | 17 #include "chrome/common/content_settings.h" |
| 18 #include "chrome/common/content_settings_types.h" | 18 #include "chrome/common/content_settings_types.h" |
| 19 #include "chrome/common/custom_handlers/protocol_handler.h" | |
| 20 #include "content/public/browser/notification_observer.h" | 19 #include "content/public/browser/notification_observer.h" |
| 21 #include "content/public/browser/notification_registrar.h" | 20 #include "content/public/browser/notification_registrar.h" |
| 22 #include "content/public/browser/web_contents_observer.h" | 21 #include "content/public/browser/web_contents_observer.h" |
| 23 | 22 |
| 24 class CookiesTreeModel; | 23 class CookiesTreeModel; |
| 25 class Profile; | 24 class Profile; |
| 26 | 25 |
| 27 namespace content { | 26 namespace content { |
| 28 class RenderViewHost; | 27 class RenderViewHost; |
| 29 } | 28 } |
| (...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 162 | 161 |
| 163 const std::set<std::string>& BlockedResourcesForType( | 162 const std::set<std::string>& BlockedResourcesForType( |
| 164 ContentSettingsType content_type) const; | 163 ContentSettingsType content_type) const; |
| 165 | 164 |
| 166 // Returns the GeolocationSettingsState that controls the | 165 // Returns the GeolocationSettingsState that controls the |
| 167 // geolocation API usage on this page. | 166 // geolocation API usage on this page. |
| 168 const GeolocationSettingsState& geolocation_settings_state() const { | 167 const GeolocationSettingsState& geolocation_settings_state() const { |
| 169 return geolocation_settings_state_; | 168 return geolocation_settings_state_; |
| 170 } | 169 } |
| 171 | 170 |
| 172 // Call to indicate that there is a protocol handler pending user approval. | |
| 173 void set_pending_protocol_handler(const ProtocolHandler& handler) { | |
| 174 pending_protocol_handler_ = handler; | |
| 175 } | |
| 176 | |
| 177 const ProtocolHandler& pending_protocol_handler() const { | |
| 178 return pending_protocol_handler_; | |
| 179 } | |
| 180 | |
| 181 void ClearPendingProtocolHandler() { | |
| 182 pending_protocol_handler_ = ProtocolHandler::EmptyProtocolHandler(); | |
| 183 } | |
| 184 | |
| 185 | |
| 186 // Sets the previous protocol handler which will be replaced by the | |
| 187 // pending protocol handler. | |
| 188 void set_previous_protocol_handler(const ProtocolHandler& handler) { | |
| 189 previous_protocol_handler_ = handler; | |
| 190 } | |
| 191 | |
| 192 const ProtocolHandler& previous_protocol_handler() const { | |
| 193 return previous_protocol_handler_; | |
| 194 } | |
| 195 | |
| 196 // Set whether the setting for the pending handler is DEFAULT (ignore), | |
| 197 // ALLOW, or DENY. | |
| 198 void set_pending_protocol_handler_setting(ContentSetting setting) { | |
| 199 pending_protocol_handler_setting_ = setting; | |
| 200 } | |
| 201 | |
| 202 ContentSetting pending_protocol_handler_setting() const { | |
| 203 return pending_protocol_handler_setting_; | |
| 204 } | |
| 205 | |
| 206 | |
| 207 // Returns a pointer to the |LocalSharedObjectsContainer| that contains all | 171 // Returns a pointer to the |LocalSharedObjectsContainer| that contains all |
| 208 // allowed local shared objects like cookies, local storage, ... . | 172 // allowed local shared objects like cookies, local storage, ... . |
| 209 const LocalSharedObjectsContainer& allowed_local_shared_objects() const { | 173 const LocalSharedObjectsContainer& allowed_local_shared_objects() const { |
| 210 return allowed_local_shared_objects_; | 174 return allowed_local_shared_objects_; |
| 211 } | 175 } |
| 212 | 176 |
| 213 // Returns a pointer to the |LocalSharedObjectsContainer| that contains all | 177 // Returns a pointer to the |LocalSharedObjectsContainer| that contains all |
| 214 // blocked local shared objects like cookies, local storage, ... . | 178 // blocked local shared objects like cookies, local storage, ... . |
| 215 const LocalSharedObjectsContainer& blocked_local_shared_objects() const { | 179 const LocalSharedObjectsContainer& blocked_local_shared_objects() const { |
| 216 return blocked_local_shared_objects_; | 180 return blocked_local_shared_objects_; |
| (...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 308 // The profile of the tab. | 272 // The profile of the tab. |
| 309 Profile* profile_; | 273 Profile* profile_; |
| 310 | 274 |
| 311 // Stores the blocked/allowed cookies. | 275 // Stores the blocked/allowed cookies. |
| 312 LocalSharedObjectsContainer allowed_local_shared_objects_; | 276 LocalSharedObjectsContainer allowed_local_shared_objects_; |
| 313 LocalSharedObjectsContainer blocked_local_shared_objects_; | 277 LocalSharedObjectsContainer blocked_local_shared_objects_; |
| 314 | 278 |
| 315 // Manages information about Geolocation API usage in this page. | 279 // Manages information about Geolocation API usage in this page. |
| 316 GeolocationSettingsState geolocation_settings_state_; | 280 GeolocationSettingsState geolocation_settings_state_; |
| 317 | 281 |
| 318 // The pending protocol handler, if any. This can be set if | |
| 319 // registerProtocolHandler was invoked without user gesture. | |
| 320 // The |IsEmpty| method will be true if no protocol handler is | |
| 321 // pending registration. | |
| 322 ProtocolHandler pending_protocol_handler_; | |
| 323 | |
| 324 // The previous protocol handler to be replaced by | |
| 325 // the pending_protocol_handler_, if there is one. Empty if | |
| 326 // there is no handler which would be replaced. | |
| 327 ProtocolHandler previous_protocol_handler_; | |
| 328 | |
| 329 // The setting on the pending protocol handler registration. Persisted in case | |
| 330 // the user opens the bubble and makes changes multiple times. | |
| 331 ContentSetting pending_protocol_handler_setting_; | |
| 332 | |
| 333 // Stores whether the user can load blocked plugins on this page. | 282 // Stores whether the user can load blocked plugins on this page. |
| 334 bool load_plugins_link_enabled_; | 283 bool load_plugins_link_enabled_; |
| 335 | 284 |
| 336 content::NotificationRegistrar registrar_; | 285 content::NotificationRegistrar registrar_; |
| 337 | 286 |
| 338 DISALLOW_COPY_AND_ASSIGN(TabSpecificContentSettings); | 287 DISALLOW_COPY_AND_ASSIGN(TabSpecificContentSettings); |
| 339 }; | 288 }; |
| 340 | 289 |
| 341 #endif // CHROME_BROWSER_CONTENT_SETTINGS_TAB_SPECIFIC_CONTENT_SETTINGS_H_ | 290 #endif // CHROME_BROWSER_CONTENT_SETTINGS_TAB_SPECIFIC_CONTENT_SETTINGS_H_ |
| OLD | NEW |