OLD | NEW |
---|---|
(Empty) | |
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. | |
4 | |
5 #ifndef CHROME_BROWSER_CONTENT_SETTINGS_CHROME_CONTENT_SETTINGS_CLIENT_H_ | |
6 #define CHROME_BROWSER_CONTENT_SETTINGS_CHROME_CONTENT_SETTINGS_CLIENT_H_ | |
7 | |
8 #include "base/memory/scoped_ptr.h" | |
9 #include "chrome/browser/browsing_data/cookies_tree_model.h" | |
10 #include "chrome/browser/content_settings/local_shared_objects_container.h" | |
11 #include "components/content_settings/core/browser/content_settings_client.h" | |
12 #include "content/public/browser/web_contents_user_data.h" | |
13 | |
14 // Chrome-specific implementation of the ContentSettingsClient interface. | |
15 class ChromeContentSettingsClient | |
16 : public content_settings::ContentSettingsClient, | |
17 public content::WebContentsUserData<ChromeContentSettingsClient> { | |
18 public: | |
19 virtual ~ChromeContentSettingsClient(); | |
20 | |
21 static void CreateForWebContents(content::WebContents* contents); | |
22 | |
23 // ContentSettingsClient implementation. | |
24 virtual void OnCookiesRead(const GURL& url, | |
25 const GURL& first_party_url, | |
26 const net::CookieList& cookie_list, | |
27 bool blocked_by_policy) override; | |
28 virtual void OnCookieChanged(const GURL& url, | |
29 const GURL& first_party_url, | |
30 const std::string& cookie_line, | |
31 const net::CookieOptions& options, | |
32 bool blocked_by_policy) override; | |
33 virtual void OnFileSystemAccessed(const GURL& url, | |
34 bool blocked_by_policy) override; | |
35 virtual void OnIndexedDBAccessed(const GURL& url, | |
36 const base::string16& description, | |
37 bool blocked_by_policy) override; | |
38 virtual void OnLocalStorageAccessed(const GURL& url, | |
39 bool local, | |
40 bool blocked_by_policy) override; | |
41 virtual void OnWebDatabaseAccessed(const GURL& url, | |
42 const base::string16& name, | |
43 const base::string16& display_name, | |
44 bool blocked_by_policy) override; | |
45 virtual const LocalSharedObjectsCounter& local_shared_objects( | |
46 AccessType type) const override; | |
47 | |
48 // Creates a new copy of a CookiesTreeModel for all allowed (or blocked, | |
49 // depending on |type) local shared objects. | |
blundell
2014/10/13 08:55:58
nit: |type|.
vabr (Chromium)
2014/10/13 09:33:17
Done.
| |
50 scoped_ptr<CookiesTreeModel> CreateCookiesTreeModel(AccessType type) const; | |
51 | |
52 private: | |
53 friend class content::WebContentsUserData<ChromeContentSettingsClient>; | |
54 | |
55 explicit ChromeContentSettingsClient(content::WebContents* contents); | |
56 | |
57 // Stores the blocked/allowed site data. | |
58 LocalSharedObjectsContainer allowed_local_shared_objects_; | |
59 LocalSharedObjectsContainer blocked_local_shared_objects_; | |
60 | |
61 DISALLOW_COPY_AND_ASSIGN(ChromeContentSettingsClient); | |
62 }; | |
63 | |
64 #endif // CHROME_BROWSER_CONTENT_SETTINGS_CHROME_CONTENT_SETTINGS_CLIENT_H_ | |
OLD | NEW |