blob: 05ae5789416fdf818da0800c24f3f839eaa4b1f2 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
|
// Copyright 2014 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 EXTENSIONS_COMMON_PERMISSIONS_MEDIA_GALLERIES_PERMISSION_DATA_H_
#define EXTENSIONS_COMMON_PERMISSIONS_MEDIA_GALLERIES_PERMISSION_DATA_H_
#include <string>
#include "base/memory/scoped_ptr.h"
#include "extensions/common/permissions/api_permission.h"
namespace base {
class Value;
}
namespace extensions {
// A MediaGalleriesPermissionData instance represents a single part of the
// MediaGalleriesPermission. e.g. "read" or "allAutoDetected".
class MediaGalleriesPermissionData {
public:
MediaGalleriesPermissionData();
// Check if |param| (which must be a MediaGalleriesPermission::CheckParam)
// matches the encapsulated attribute.
bool Check(const APIPermission::CheckParam* param) const;
// Convert |this| into a base::Value.
scoped_ptr<base::Value> ToValue() const;
// Populate |this| from a base::Value.
bool FromValue(const base::Value* value);
bool operator<(const MediaGalleriesPermissionData& rhs) const;
bool operator==(const MediaGalleriesPermissionData& rhs) const;
std::string permission() const { return permission_; }
// This accessor is provided for IPC_STRUCT_TRAITS_MEMBER. Please think
// twice before using it for anything else.
std::string& permission() { return permission_; }
private:
std::string permission_;
};
} // namespace extensions
#endif // EXTENSIONS_COMMON_PERMISSIONS_MEDIA_GALLERIES_PERMISSION_DATA_H_
|