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

Side by Side Diff: chrome/browser/content_settings/tab_specific_content_settings.h

Issue 588583002: LocalSharedObjectsContainer: Separate object counting in an interface (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 months 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 unified diff | Download patch
OLDNEW
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 <string> 8 #include <string>
9 9
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
11 #include "base/memory/ref_counted.h" 11 #include "base/memory/ref_counted.h"
12 #include "base/memory/scoped_ptr.h" 12 #include "base/memory/scoped_ptr.h"
13 #include "base/observer_list.h" 13 #include "base/observer_list.h"
14 #include "base/scoped_observer.h" 14 #include "base/scoped_observer.h"
15 #include "chrome/browser/browsing_data/cookies_tree_model.h"
15 #include "chrome/browser/content_settings/content_settings_usages_state.h" 16 #include "chrome/browser/content_settings/content_settings_usages_state.h"
16 #include "chrome/browser/content_settings/local_shared_objects_container.h" 17 #include "chrome/browser/content_settings/local_shared_objects_container.h"
17 #include "chrome/browser/media/media_stream_devices_controller.h" 18 #include "chrome/browser/media/media_stream_devices_controller.h"
18 #include "chrome/common/custom_handlers/protocol_handler.h" 19 #include "chrome/common/custom_handlers/protocol_handler.h"
19 #include "components/content_settings/core/browser/content_settings_observer.h" 20 #include "components/content_settings/core/browser/content_settings_observer.h"
20 #include "components/content_settings/core/common/content_settings.h" 21 #include "components/content_settings/core/common/content_settings.h"
21 #include "components/content_settings/core/common/content_settings_types.h" 22 #include "components/content_settings/core/common/content_settings_types.h"
22 #include "content/public/browser/web_contents_observer.h" 23 #include "content/public/browser/web_contents_observer.h"
23 #include "content/public/browser/web_contents_user_data.h" 24 #include "content/public/browser/web_contents_user_data.h"
24 #include "content/public/common/media_stream_request.h" 25 #include "content/public/common/media_stream_request.h"
25 #include "net/cookies/canonical_cookie.h" 26 #include "net/cookies/canonical_cookie.h"
26 27
27 class CookiesTreeModel;
28 class HostContentSettingsMap; 28 class HostContentSettingsMap;
29 class Profile; 29 class Profile;
30 30
31 namespace content { 31 namespace content {
32 class RenderViewHost; 32 class RenderViewHost;
33 } 33 }
34 34
35 namespace net { 35 namespace net {
36 class CookieOptions; 36 class CookieOptions;
37 } 37 }
(...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after
252 // Set whether the setting for the pending handler is DEFAULT (ignore), 252 // Set whether the setting for the pending handler is DEFAULT (ignore),
253 // ALLOW, or DENY. 253 // ALLOW, or DENY.
254 void set_pending_protocol_handler_setting(ContentSetting setting) { 254 void set_pending_protocol_handler_setting(ContentSetting setting) {
255 pending_protocol_handler_setting_ = setting; 255 pending_protocol_handler_setting_ = setting;
256 } 256 }
257 257
258 ContentSetting pending_protocol_handler_setting() const { 258 ContentSetting pending_protocol_handler_setting() const {
259 return pending_protocol_handler_setting_; 259 return pending_protocol_handler_setting_;
260 } 260 }
261 261
262 262 // Returns the |LocalSharedObjectsCounter| instances corresponding to all
263 // Returns a pointer to the |LocalSharedObjectsContainer| that contains all 263 // allowed, and blocked, respectively, local shared objects like cookies,
264 // allowed local shared objects like cookies, local storage, ... . 264 // local storage, ... .
265 const LocalSharedObjectsContainer& allowed_local_shared_objects() const { 265 const LocalSharedObjectsCounter& allowed_local_shared_objects() const {
266 return allowed_local_shared_objects_; 266 return allowed_local_shared_objects_;
267 } 267 }
268 const LocalSharedObjectsCounter& blocked_local_shared_objects() const {
markusheintz_ 2014/10/01 11:12:07 nit: pls add an empty line above
vabr (Chromium) 2014/10/01 15:25:48 Done.
269 return blocked_local_shared_objects_;
270 }
268 271
269 // Returns a pointer to the |LocalSharedObjectsContainer| that contains all 272 // Creates a new copy of a CookiesTreeModel for all allowed, and blocked,
270 // blocked local shared objects like cookies, local storage, ... . 273 // respectively, local shared objects.
271 const LocalSharedObjectsContainer& blocked_local_shared_objects() const { 274 scoped_ptr<CookiesTreeModel> CreateAllowedCookiesTreeModel() const {
272 return blocked_local_shared_objects_; 275 return allowed_local_shared_objects_.CreateCookiesTreeModel();
276 }
277 scoped_ptr<CookiesTreeModel> CreateBlockedCookiesTreeModel() const {
markusheintz_ 2014/10/01 11:12:07 nit: pls add an empty line above
vabr (Chromium) 2014/10/01 15:25:48 Done.
278 return blocked_local_shared_objects_.CreateCookiesTreeModel();
273 } 279 }
274 280
275 bool load_plugins_link_enabled() { return load_plugins_link_enabled_; } 281 bool load_plugins_link_enabled() { return load_plugins_link_enabled_; }
276 void set_load_plugins_link_enabled(bool enabled) { 282 void set_load_plugins_link_enabled(bool enabled) {
277 load_plugins_link_enabled_ = enabled; 283 load_plugins_link_enabled_ = enabled;
278 } 284 }
279 285
280 // Called to indicate whether access to the Pepper broker was allowed or 286 // Called to indicate whether access to the Pepper broker was allowed or
281 // blocked. 287 // blocked.
282 void SetPepperBrokerAllowed(bool allowed); 288 void SetPepperBrokerAllowed(bool allowed);
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after
418 std::string media_stream_requested_audio_device_; 424 std::string media_stream_requested_audio_device_;
419 std::string media_stream_requested_video_device_; 425 std::string media_stream_requested_video_device_;
420 426
421 // Observer to watch for content settings changed. 427 // Observer to watch for content settings changed.
422 ScopedObserver<HostContentSettingsMap, content_settings::Observer> observer_; 428 ScopedObserver<HostContentSettingsMap, content_settings::Observer> observer_;
423 429
424 DISALLOW_COPY_AND_ASSIGN(TabSpecificContentSettings); 430 DISALLOW_COPY_AND_ASSIGN(TabSpecificContentSettings);
425 }; 431 };
426 432
427 #endif // CHROME_BROWSER_CONTENT_SETTINGS_TAB_SPECIFIC_CONTENT_SETTINGS_H_ 433 #endif // CHROME_BROWSER_CONTENT_SETTINGS_TAB_SPECIFIC_CONTENT_SETTINGS_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698