| 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" |
| 19 #include "content/public/browser/notification_observer.h" | 20 #include "content/public/browser/notification_observer.h" |
| 20 #include "content/public/browser/notification_registrar.h" | 21 #include "content/public/browser/notification_registrar.h" |
| 21 #include "content/public/browser/web_contents_observer.h" | 22 #include "content/public/browser/web_contents_observer.h" |
| 22 | 23 |
| 23 class CookiesTreeModel; | 24 class CookiesTreeModel; |
| 24 class Profile; | 25 class Profile; |
| 25 | 26 |
| 26 namespace content { | 27 namespace content { |
| 27 class RenderViewHost; | 28 class RenderViewHost; |
| 28 } | 29 } |
| (...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 161 | 162 |
| 162 const std::set<std::string>& BlockedResourcesForType( | 163 const std::set<std::string>& BlockedResourcesForType( |
| 163 ContentSettingsType content_type) const; | 164 ContentSettingsType content_type) const; |
| 164 | 165 |
| 165 // Returns the GeolocationSettingsState that controls the | 166 // Returns the GeolocationSettingsState that controls the |
| 166 // geolocation API usage on this page. | 167 // geolocation API usage on this page. |
| 167 const GeolocationSettingsState& geolocation_settings_state() const { | 168 const GeolocationSettingsState& geolocation_settings_state() const { |
| 168 return geolocation_settings_state_; | 169 return geolocation_settings_state_; |
| 169 } | 170 } |
| 170 | 171 |
| 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 |
| 171 // Returns a pointer to the |LocalSharedObjectsContainer| that contains all | 207 // Returns a pointer to the |LocalSharedObjectsContainer| that contains all |
| 172 // allowed local shared objects like cookies, local storage, ... . | 208 // allowed local shared objects like cookies, local storage, ... . |
| 173 const LocalSharedObjectsContainer& allowed_local_shared_objects() const { | 209 const LocalSharedObjectsContainer& allowed_local_shared_objects() const { |
| 174 return allowed_local_shared_objects_; | 210 return allowed_local_shared_objects_; |
| 175 } | 211 } |
| 176 | 212 |
| 177 // Returns a pointer to the |LocalSharedObjectsContainer| that contains all | 213 // Returns a pointer to the |LocalSharedObjectsContainer| that contains all |
| 178 // blocked local shared objects like cookies, local storage, ... . | 214 // blocked local shared objects like cookies, local storage, ... . |
| 179 const LocalSharedObjectsContainer& blocked_local_shared_objects() const { | 215 const LocalSharedObjectsContainer& blocked_local_shared_objects() const { |
| 180 return blocked_local_shared_objects_; | 216 return blocked_local_shared_objects_; |
| (...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 272 // The profile of the tab. | 308 // The profile of the tab. |
| 273 Profile* profile_; | 309 Profile* profile_; |
| 274 | 310 |
| 275 // Stores the blocked/allowed cookies. | 311 // Stores the blocked/allowed cookies. |
| 276 LocalSharedObjectsContainer allowed_local_shared_objects_; | 312 LocalSharedObjectsContainer allowed_local_shared_objects_; |
| 277 LocalSharedObjectsContainer blocked_local_shared_objects_; | 313 LocalSharedObjectsContainer blocked_local_shared_objects_; |
| 278 | 314 |
| 279 // Manages information about Geolocation API usage in this page. | 315 // Manages information about Geolocation API usage in this page. |
| 280 GeolocationSettingsState geolocation_settings_state_; | 316 GeolocationSettingsState geolocation_settings_state_; |
| 281 | 317 |
| 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 |
| 282 // Stores whether the user can load blocked plugins on this page. | 333 // Stores whether the user can load blocked plugins on this page. |
| 283 bool load_plugins_link_enabled_; | 334 bool load_plugins_link_enabled_; |
| 284 | 335 |
| 285 content::NotificationRegistrar registrar_; | 336 content::NotificationRegistrar registrar_; |
| 286 | 337 |
| 287 DISALLOW_COPY_AND_ASSIGN(TabSpecificContentSettings); | 338 DISALLOW_COPY_AND_ASSIGN(TabSpecificContentSettings); |
| 288 }; | 339 }; |
| 289 | 340 |
| 290 #endif // CHROME_BROWSER_CONTENT_SETTINGS_TAB_SPECIFIC_CONTENT_SETTINGS_H_ | 341 #endif // CHROME_BROWSER_CONTENT_SETTINGS_TAB_SPECIFIC_CONTENT_SETTINGS_H_ |
| OLD | NEW |