| 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..e1b988e76db724009724385ba4e025096c2a4812
|
| --- /dev/null
|
| +++ b/chrome/browser/permissions/chooser_permission_context_base.h
|
| @@ -0,0 +1,63 @@
|
| +// 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 <string>
|
| +
|
| +#include "base/memory/scoped_ptr.h"
|
| +#include "base/memory/scoped_vector.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;
|
| +}
|
| +
|
| +class GURL;
|
| +class Profile;
|
| +
|
| +class ChooserPermissionContextBase : public KeyedService {
|
| + public:
|
| + using ObjectList = ScopedVector<base::DictionaryValue>;
|
| +
|
| + ChooserPermissionContextBase(Profile* profile,
|
| + content::PermissionType permission_type,
|
| + ContentSettingsType chooser_settings_type);
|
| + ~ChooserPermissionContextBase() override;
|
| +
|
| + ObjectList GetPreviouslyChosenObjects(const GURL& requesting_origin,
|
| + const GURL& embedding_origin);
|
| + void GrantObjectPermission(const GURL& requesting_origin,
|
| + const GURL& embedding_origin,
|
| + scoped_ptr<base::DictionaryValue> object);
|
| + void RevokeObjectPermission(const GURL& requesting_origin,
|
| + const GURL& embedding_origin,
|
| + const base::DictionaryValue& object);
|
| +
|
| + virtual bool IsValidObject(const base::DictionaryValue& object) = 0;
|
| + virtual std::string GetStringToDisplayForObject(
|
| + const base::DictionaryValue& object) = 0;
|
| +
|
| + 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_
|
|
|