Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(54)

Unified Diff: extensions/common/permissions/mock_manifest_permission.h

Issue 2850493002: Extracted MockManifestPermission to its own file (Closed)
Patch Set: Put MockManifestPermission in extensions/BUILD.gn Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: extensions/common/permissions/mock_manifest_permission.h
diff --git a/extensions/common/permissions/mock_manifest_permission.h b/extensions/common/permissions/mock_manifest_permission.h
new file mode 100644
index 0000000000000000000000000000000000000000..ce4a2bada4d7ca4a4ed0ff545a56003b5c2a8b15
--- /dev/null
+++ b/extensions/common/permissions/mock_manifest_permission.h
@@ -0,0 +1,39 @@
+// Copyright 2017 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_MOCK_MANIFEST_PERMISSION_H_
+#define EXTENSIONS_COMMON_PERMISSIONS_MOCK_MANIFEST_PERMISSION_H_
+
+#include <memory>
+#include <string>
+
+#include "base/values.h"
Devlin 2017/04/28 17:09:54 I think a forward declaration is sufficient here.
Ivan Šandrk 2017/05/02 12:12:56 Done.
+#include "extensions/common/permissions/api_permission_set.h"
Devlin 2017/04/28 17:09:54 needed?
Ivan Šandrk 2017/05/02 12:12:56 Done.
+#include "extensions/common/permissions/manifest_permission.h"
+
+namespace extensions {
+
+class MockManifestPermission : public ManifestPermission {
Devlin 2017/04/28 17:09:54 Add a brief class comment
Ivan Šandrk 2017/05/02 12:12:56 Done.
+ public:
+ explicit MockManifestPermission(const std::string& name);
+
+ std::string name() const override;
+ std::string id() const override;
+
+ PermissionIDSet GetPermissions() const override;
+
+ bool FromValue(const base::Value* value) override;
+ std::unique_ptr<base::Value> ToValue() const override;
+
+ ManifestPermission* Diff(const ManifestPermission* rhs) const override;
+ ManifestPermission* Union(const ManifestPermission* rhs) const override;
+ ManifestPermission* Intersect(const ManifestPermission* rhs) const override;
+
+ private:
+ std::string name_;
Devlin 2017/04/28 17:09:54 DISALLOW_COPY_AND_ASSIGN
Ivan Šandrk 2017/05/02 12:12:56 Done.
+};
+
+} // namespace extensions
+
+#endif // EXTENSIONS_COMMON_PERMISSIONS_MOCK_MANIFEST_PERMISSION_H_

Powered by Google App Engine
This is Rietveld 408576698