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 #ifndef COMPONENTS_CONTENT_SETTINGS_CORE_BROWSER_CONTENT_SETTINGS_CLIENT_H_
6 #define COMPONENTS_CONTENT_SETTINGS_CORE_BROWSER_CONTENT_SETTINGS_CLIENT_H_
10 #include "base/basictypes.h"
11 #include "base/strings/string16.h"
12 #include "net/cookies/canonical_cookie.h"
15 class LocalSharedObjectsCounter
;
21 namespace content_settings
{
23 // An abstraction of operations that depend on the embedder (e.g. Chrome).
24 class ContentSettingsClient
{
26 enum AccessType
{ BLOCKED
, ALLOWED
};
28 ContentSettingsClient() {}
29 virtual ~ContentSettingsClient() {}
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;
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;
43 virtual void OnFileSystemAccessed(const GURL
& url
,
44 bool blocked_by_policy
) = 0;
46 virtual void OnIndexedDBAccessed(const GURL
& url
,
47 const base::string16
& description
,
48 bool blocked_by_policy
) = 0;
50 virtual void OnLocalStorageAccessed(const GURL
& url
,
52 bool blocked_by_policy
) = 0;
54 virtual void OnWebDatabaseAccessed(const GURL
& url
,
55 const base::string16
& name
,
56 const base::string16
& display_name
,
57 bool blocked_by_policy
) = 0;
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;
65 DISALLOW_COPY_AND_ASSIGN(ContentSettingsClient
);
68 } // namespace content_settings
70 #endif // COMPONENTS_CONTENT_SETTINGS_CORE_BROWSER_CONTENT_SETTINGS_CLIENT_H_