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

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: Just rebased Created 6 years, 2 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 226 matching lines...) Expand 10 before | Expand all | Expand 10 after
264 // Set whether the setting for the pending handler is DEFAULT (ignore), 264 // Set whether the setting for the pending handler is DEFAULT (ignore),
265 // ALLOW, or DENY. 265 // ALLOW, or DENY.
266 void set_pending_protocol_handler_setting(ContentSetting setting) { 266 void set_pending_protocol_handler_setting(ContentSetting setting) {
267 pending_protocol_handler_setting_ = setting; 267 pending_protocol_handler_setting_ = setting;
268 } 268 }
269 269
270 ContentSetting pending_protocol_handler_setting() const { 270 ContentSetting pending_protocol_handler_setting() const {
271 return pending_protocol_handler_setting_; 271 return pending_protocol_handler_setting_;
272 } 272 }
273 273
274 274 // Returns the |LocalSharedObjectsCounter| instances corresponding to all
275 // Returns a pointer to the |LocalSharedObjectsContainer| that contains all 275 // allowed, and blocked, respectively, local shared objects like cookies,
276 // allowed local shared objects like cookies, local storage, ... . 276 // local storage, ... .
277 const LocalSharedObjectsContainer& allowed_local_shared_objects() const { 277 const LocalSharedObjectsCounter& allowed_local_shared_objects() const {
278 return allowed_local_shared_objects_; 278 return allowed_local_shared_objects_;
279 } 279 }
280 280
281 // Returns a pointer to the |LocalSharedObjectsContainer| that contains all 281 const LocalSharedObjectsCounter& blocked_local_shared_objects() const {
282 // blocked local shared objects like cookies, local storage, ... .
283 const LocalSharedObjectsContainer& blocked_local_shared_objects() const {
284 return blocked_local_shared_objects_; 282 return blocked_local_shared_objects_;
285 } 283 }
286 284
285 // Creates a new copy of a CookiesTreeModel for all allowed, and blocked,
286 // respectively, local shared objects.
287 scoped_ptr<CookiesTreeModel> CreateAllowedCookiesTreeModel() const {
288 return allowed_local_shared_objects_.CreateCookiesTreeModel();
289 }
290
291 scoped_ptr<CookiesTreeModel> CreateBlockedCookiesTreeModel() const {
292 return blocked_local_shared_objects_.CreateCookiesTreeModel();
293 }
294
287 bool load_plugins_link_enabled() { return load_plugins_link_enabled_; } 295 bool load_plugins_link_enabled() { return load_plugins_link_enabled_; }
288 void set_load_plugins_link_enabled(bool enabled) { 296 void set_load_plugins_link_enabled(bool enabled) {
289 load_plugins_link_enabled_ = enabled; 297 load_plugins_link_enabled_ = enabled;
290 } 298 }
291 299
292 // Called to indicate whether access to the Pepper broker was allowed or 300 // Called to indicate whether access to the Pepper broker was allowed or
293 // blocked. 301 // blocked.
294 void SetPepperBrokerAllowed(bool allowed); 302 void SetPepperBrokerAllowed(bool allowed);
295 303
296 // content::WebContentsObserver overrides. 304 // content::WebContentsObserver overrides.
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after
437 std::string media_stream_requested_audio_device_; 445 std::string media_stream_requested_audio_device_;
438 std::string media_stream_requested_video_device_; 446 std::string media_stream_requested_video_device_;
439 447
440 // Observer to watch for content settings changed. 448 // Observer to watch for content settings changed.
441 ScopedObserver<HostContentSettingsMap, content_settings::Observer> observer_; 449 ScopedObserver<HostContentSettingsMap, content_settings::Observer> observer_;
442 450
443 DISALLOW_COPY_AND_ASSIGN(TabSpecificContentSettings); 451 DISALLOW_COPY_AND_ASSIGN(TabSpecificContentSettings);
444 }; 452 };
445 453
446 #endif // CHROME_BROWSER_CONTENT_SETTINGS_TAB_SPECIFIC_CONTENT_SETTINGS_H_ 454 #endif // CHROME_BROWSER_CONTENT_SETTINGS_TAB_SPECIFIC_CONTENT_SETTINGS_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698