Chromium Code Reviews| Index: chrome/browser/permissions/chooser_permission_context_base.h |
| diff --git a/chrome/browser/permissions/chooser_permission_context_base.h b/chrome/browser/permissions/chooser_permission_context_base.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..1448073746b3101380473e095344c085b0f086b4 |
| --- /dev/null |
| +++ b/chrome/browser/permissions/chooser_permission_context_base.h |
| @@ -0,0 +1,55 @@ |
| +// Copyright 2015 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#ifndef CHROME_BROWSER_PERMISSIONS_CHOOSER_PERMISSION_CONTEXT_BASE_H_ |
| +#define CHROME_BROWSER_PERMISSIONS_CHOOSER_PERMISSION_CONTEXT_BASE_H_ |
| + |
| +#include "base/memory/scoped_ptr.h" |
| +#include "components/content_settings/core/common/content_settings_types.h" |
| +#include "components/keyed_service/core/keyed_service.h" |
| + |
| +namespace base { |
| +class DictionaryValue; |
| +class ListValue; |
| +class Value; |
| +} |
| + |
| +namespace content { |
| +enum class PermissionType; |
| +}; |
|
Bernhard Bauer
2015/10/12 11:03:48
No semicolon.
Reilly Grant (use Gerrit)
2015/10/13 01:32:24
Done.
|
| + |
| +class GURL; |
| +class Profile; |
| + |
| +class ChooserPermissionContextBase : public KeyedService { |
| + public: |
| + ChooserPermissionContextBase(Profile* profile, |
| + content::PermissionType permission_type, |
| + ContentSettingsType chooser_settings_type); |
| + ~ChooserPermissionContextBase() override; |
| + |
| + scoped_ptr<base::ListValue> GetPreviouslyChosenObjects( |
| + const GURL& requesting_origin, |
| + const GURL& embedding_origin); |
| + void GrantObjectPermission(const GURL& requesting_origin, |
| + const GURL& embedding_origin, |
| + scoped_ptr<base::Value> object); |
| + void RevokeObjectPermission(const GURL& requesting_origin, |
| + const GURL& embedding_origin, |
| + const base::Value& object); |
| + |
| + private: |
| + scoped_ptr<base::DictionaryValue> GetWebsiteSetting( |
| + const GURL& requesting_origin, |
| + const GURL& embedding_origin); |
| + void SetWebsiteSetting(const GURL& requesting_origin, |
| + const GURL& embedding_origin, |
| + scoped_ptr<base::Value> value); |
| + |
| + Profile* const profile_; |
| + const content::PermissionType permission_type_; |
| + const ContentSettingsType chooser_settings_type_; |
| +}; |
| + |
| +#endif // CHROME_BROWSER_PERMISSIONS_CHOOSER_PERMISSION_CONTEXT_BASE_H_ |