1 // Copyright (c) 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #include "chrome/browser/content_settings/chrome_content_settings_client.h"
6 #include "chrome/browser/profiles/profile.h"
8 DEFINE_WEB_CONTENTS_USER_DATA_KEY(ChromeContentSettingsClient
);
10 ChromeContentSettingsClient::~ChromeContentSettingsClient() {
13 void ChromeContentSettingsClient::OnCookiesRead(
15 const GURL
& first_party_url
,
16 const net::CookieList
& cookie_list
,
17 bool blocked_by_policy
) {
18 // TODO(vabr): This is just a dummy implementation, replace with methods from
19 // TabSpecificContentSettings.
22 void ChromeContentSettingsClient::OnCookieChanged(
24 const GURL
& first_party_url
,
25 const std::string
& cookie_line
,
26 const net::CookieOptions
& options
,
27 bool blocked_by_policy
) {
28 // TODO(vabr): This is just a dummy implementation, replace with methods from
29 // TabSpecificContentSettings.
32 void ChromeContentSettingsClient::OnFileSystemAccessed(const GURL
& url
,
33 bool blocked_by_policy
) {
34 // TODO(vabr): This is just a dummy implementation, replace with methods from
35 // TabSpecificContentSettings.
38 void ChromeContentSettingsClient::OnIndexedDBAccessed(
40 const base::string16
& description
,
41 bool blocked_by_policy
) {
42 // TODO(vabr): This is just a dummy implementation, replace with methods from
43 // TabSpecificContentSettings.
46 void ChromeContentSettingsClient::OnLocalStorageAccessed(
49 bool blocked_by_policy
) {
50 // TODO(vabr): This is just a dummy implementation, replace with methods from
51 // TabSpecificContentSettings.
54 void ChromeContentSettingsClient::OnWebDatabaseAccessed(
56 const base::string16
& name
,
57 const base::string16
& display_name
,
58 bool blocked_by_policy
) {
59 // TODO(vabr): This is just a dummy implementation, replace with methods from
60 // TabSpecificContentSettings.
63 const LocalSharedObjectsCounter
&
64 ChromeContentSettingsClient::local_shared_objects(AccessType type
) const {
67 return allowed_local_shared_objects_
;
69 return blocked_local_shared_objects_
;
71 // Some compilers don't believe this is not reachable, so let's return a dummy
74 return blocked_local_shared_objects_
;
77 scoped_ptr
<CookiesTreeModel
>
78 ChromeContentSettingsClient::CreateCookiesTreeModel(AccessType type
) const {
81 return allowed_local_shared_objects_
.CreateCookiesTreeModel();
83 return blocked_local_shared_objects_
.CreateCookiesTreeModel();
85 // Some compilers don't believe this is not reachable, so let's return a dummy
88 return scoped_ptr
<CookiesTreeModel
>();
91 ChromeContentSettingsClient::ChromeContentSettingsClient(
92 content::WebContents
* contents
)
93 : allowed_local_shared_objects_(
94 Profile::FromBrowserContext(contents
->GetBrowserContext())),
95 blocked_local_shared_objects_(
96 Profile::FromBrowserContext(contents
->GetBrowserContext())) {