| 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 <memory> | |
| 9 | |
| 10 #include "base/macros.h" | |
| 11 #include "chrome/browser/browsing_data/cookies_tree_model.h" | |
| 12 #include "chrome/browser/content_settings/local_shared_objects_container.h" | |
| 13 #include "components/content_settings/core/browser/content_settings_client.h" | |
| 14 #include "content/public/browser/web_contents_user_data.h" | |
| 15 | |
| 16 // Chrome-specific implementation of the ContentSettingsClient interface. | |
| 17 class ChromeContentSettingsClient | |
| 18 : public content_settings::ContentSettingsClient, | |
| 19 public content::WebContentsUserData<ChromeContentSettingsClient> { | |
| 20 public: | |
| 21 ~ChromeContentSettingsClient() override; | |
| 22 | |
| 23 // ContentSettingsClient implementation. | |
| 24 void OnCookiesRead(const GURL& url, | |
| 25 const GURL& first_party_url, | |
| 26 const net::CookieList& cookie_list, | |
| 27 bool blocked_by_policy) override; | |
| 28 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 void OnFileSystemAccessed(const GURL& url, bool blocked_by_policy) override; | |
| 34 void OnIndexedDBAccessed(const GURL& url, | |
| 35 const base::string16& description, | |
| 36 bool blocked_by_policy) override; | |
| 37 void OnLocalStorageAccessed(const GURL& url, | |
| 38 bool local, | |
| 39 bool blocked_by_policy) override; | |
| 40 void OnWebDatabaseAccessed(const GURL& url, | |
| 41 const base::string16& name, | |
| 42 const base::string16& display_name, | |
| 43 bool blocked_by_policy) override; | |
| 44 const LocalSharedObjectsCounter& local_shared_objects( | |
| 45 AccessType type) const override; | |
| 46 | |
| 47 // Creates a new copy of a CookiesTreeModel for all allowed (or blocked, | |
| 48 // depending on |type|) local shared objects. | |
| 49 std::unique_ptr<CookiesTreeModel> CreateCookiesTreeModel( | |
| 50 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 |