| 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 <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <map> | 10 #include <map> |
| 11 #include <memory> | 11 #include <memory> |
| 12 #include <string> | 12 #include <string> |
| 13 | 13 |
| 14 #include "base/macros.h" | 14 #include "base/macros.h" |
| 15 #include "base/memory/ref_counted.h" | 15 #include "base/memory/ref_counted.h" |
| 16 #include "base/observer_list.h" | 16 #include "base/observer_list.h" |
| 17 #include "base/scoped_observer.h" | 17 #include "base/scoped_observer.h" |
| 18 #include "build/build_config.h" | 18 #include "build/build_config.h" |
| 19 #include "chrome/browser/browsing_data/cookies_tree_model.h" | |
| 20 #include "chrome/browser/content_settings/local_shared_objects_container.h" | 19 #include "chrome/browser/content_settings/local_shared_objects_container.h" |
| 21 #include "chrome/common/custom_handlers/protocol_handler.h" | 20 #include "chrome/common/custom_handlers/protocol_handler.h" |
| 22 #include "components/content_settings/core/browser/content_settings_observer.h" | 21 #include "components/content_settings/core/browser/content_settings_observer.h" |
| 23 #include "components/content_settings/core/browser/content_settings_usages_state
.h" | 22 #include "components/content_settings/core/browser/content_settings_usages_state
.h" |
| 24 #include "components/content_settings/core/common/content_settings.h" | 23 #include "components/content_settings/core/common/content_settings.h" |
| 25 #include "components/content_settings/core/common/content_settings_types.h" | 24 #include "components/content_settings/core/common/content_settings_types.h" |
| 26 #include "content/public/browser/web_contents_observer.h" | 25 #include "content/public/browser/web_contents_observer.h" |
| 27 #include "content/public/browser/web_contents_user_data.h" | 26 #include "content/public/browser/web_contents_user_data.h" |
| 28 #include "net/cookies/canonical_cookie.h" | 27 #include "net/cookies/canonical_cookie.h" |
| 29 | 28 |
| (...skipping 258 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 288 // Set whether the setting for the pending handler is DEFAULT (ignore), | 287 // Set whether the setting for the pending handler is DEFAULT (ignore), |
| 289 // ALLOW, or DENY. | 288 // ALLOW, or DENY. |
| 290 void set_pending_protocol_handler_setting(ContentSetting setting) { | 289 void set_pending_protocol_handler_setting(ContentSetting setting) { |
| 291 pending_protocol_handler_setting_ = setting; | 290 pending_protocol_handler_setting_ = setting; |
| 292 } | 291 } |
| 293 | 292 |
| 294 ContentSetting pending_protocol_handler_setting() const { | 293 ContentSetting pending_protocol_handler_setting() const { |
| 295 return pending_protocol_handler_setting_; | 294 return pending_protocol_handler_setting_; |
| 296 } | 295 } |
| 297 | 296 |
| 298 // Returns the |LocalSharedObjectsCounter| instances corresponding to all | 297 // Returns the |LocalSharedObjectsContainer| instances corresponding to all |
| 299 // allowed, and blocked, respectively, local shared objects like cookies, | 298 // allowed, and blocked, respectively, local shared objects like cookies, |
| 300 // local storage, ... . | 299 // local storage, ... . |
| 301 const LocalSharedObjectsCounter& allowed_local_shared_objects() const { | 300 const LocalSharedObjectsContainer& allowed_local_shared_objects() const { |
| 302 return allowed_local_shared_objects_; | 301 return allowed_local_shared_objects_; |
| 303 } | 302 } |
| 304 | 303 |
| 305 const LocalSharedObjectsCounter& blocked_local_shared_objects() const { | 304 const LocalSharedObjectsContainer& blocked_local_shared_objects() const { |
| 306 return blocked_local_shared_objects_; | 305 return blocked_local_shared_objects_; |
| 307 } | 306 } |
| 308 | 307 |
| 309 // Creates a new copy of a CookiesTreeModel for all allowed, and blocked, | |
| 310 // respectively, local shared objects. | |
| 311 std::unique_ptr<CookiesTreeModel> CreateAllowedCookiesTreeModel() const { | |
| 312 return allowed_local_shared_objects_.CreateCookiesTreeModel(); | |
| 313 } | |
| 314 | |
| 315 std::unique_ptr<CookiesTreeModel> CreateBlockedCookiesTreeModel() const { | |
| 316 return blocked_local_shared_objects_.CreateCookiesTreeModel(); | |
| 317 } | |
| 318 | |
| 319 bool load_plugins_link_enabled() { return load_plugins_link_enabled_; } | 308 bool load_plugins_link_enabled() { return load_plugins_link_enabled_; } |
| 320 void set_load_plugins_link_enabled(bool enabled) { | 309 void set_load_plugins_link_enabled(bool enabled) { |
| 321 load_plugins_link_enabled_ = enabled; | 310 load_plugins_link_enabled_ = enabled; |
| 322 } | 311 } |
| 323 | 312 |
| 324 // Called to indicate whether access to the Pepper broker was allowed or | 313 // Called to indicate whether access to the Pepper broker was allowed or |
| 325 // blocked. | 314 // blocked. |
| 326 void SetPepperBrokerAllowed(bool allowed); | 315 void SetPepperBrokerAllowed(bool allowed); |
| 327 | 316 |
| 328 // Message handlers. | 317 // Message handlers. |
| (...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 491 // Holds the previous committed url during a navigation. | 480 // Holds the previous committed url during a navigation. |
| 492 GURL previous_url_; | 481 GURL previous_url_; |
| 493 | 482 |
| 494 // Observer to watch for content settings changed. | 483 // Observer to watch for content settings changed. |
| 495 ScopedObserver<HostContentSettingsMap, content_settings::Observer> observer_; | 484 ScopedObserver<HostContentSettingsMap, content_settings::Observer> observer_; |
| 496 | 485 |
| 497 DISALLOW_COPY_AND_ASSIGN(TabSpecificContentSettings); | 486 DISALLOW_COPY_AND_ASSIGN(TabSpecificContentSettings); |
| 498 }; | 487 }; |
| 499 | 488 |
| 500 #endif // CHROME_BROWSER_CONTENT_SETTINGS_TAB_SPECIFIC_CONTENT_SETTINGS_H_ | 489 #endif // CHROME_BROWSER_CONTENT_SETTINGS_TAB_SPECIFIC_CONTENT_SETTINGS_H_ |
| OLD | NEW |