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 COMPONENTS_CONTENT_SETTINGS_CORE_BROWSER_CONTENT_SETTINGS_CLIENT_H_ | |
6 #define COMPONENTS_CONTENT_SETTINGS_CORE_BROWSER_CONTENT_SETTINGS_CLIENT_H_ | |
7 | |
8 #include <string> | |
9 | |
10 #include "base/macros.h" | |
11 #include "base/strings/string16.h" | |
12 #include "net/cookies/canonical_cookie.h" | |
13 | |
14 class GURL; | |
15 class LocalSharedObjectsCounter; | |
16 | |
17 namespace net { | |
18 class CookieOptions; | |
19 } | |
20 | |
21 namespace content_settings { | |
22 | |
23 // An abstraction of operations that depend on the embedder (e.g. Chrome). | |
24 class ContentSettingsClient { | |
25 public: | |
26 enum AccessType { BLOCKED, ALLOWED }; | |
27 | |
28 ContentSettingsClient() {} | |
29 virtual ~ContentSettingsClient() {} | |
30 | |
31 // Methods to notify the client about access to local shared objects. | |
32 virtual void OnCookiesRead(const GURL& url, | |
33 const GURL& first_party_url, | |
34 const net::CookieList& cookie_list, | |
35 bool blocked_by_policy) = 0; | |
36 | |
37 virtual void OnCookieChanged(const GURL& url, | |
38 const GURL& first_party_url, | |
39 const std::string& cookie_line, | |
40 const net::CookieOptions& options, | |
41 bool blocked_by_policy) = 0; | |
42 | |
43 virtual void OnFileSystemAccessed(const GURL& url, | |
44 bool blocked_by_policy) = 0; | |
45 | |
46 virtual void OnIndexedDBAccessed(const GURL& url, | |
47 const base::string16& description, | |
48 bool blocked_by_policy) = 0; | |
49 | |
50 virtual void OnLocalStorageAccessed(const GURL& url, | |
51 bool local, | |
52 bool blocked_by_policy) = 0; | |
53 | |
54 virtual void OnWebDatabaseAccessed(const GURL& url, | |
55 const base::string16& name, | |
56 const base::string16& display_name, | |
57 bool blocked_by_policy) = 0; | |
58 | |
59 // Returns the |LocalSharedObjectsCounter| instances corresponding to all | |
60 // allowed (or blocked, depending on |type|) local shared objects. | |
61 virtual const LocalSharedObjectsCounter& local_shared_objects( | |
62 AccessType type) const = 0; | |
63 | |
64 private: | |
65 DISALLOW_COPY_AND_ASSIGN(ContentSettingsClient); | |
66 }; | |
67 | |
68 } // namespace content_settings | |
69 | |
70 #endif // COMPONENTS_CONTENT_SETTINGS_CORE_BROWSER_CONTENT_SETTINGS_CLIENT_H_ | |
OLD | NEW |