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

Unified Diff: chrome/common/extensions/permissions/media_galleries_permission_data.cc

Issue 201203006: Move basic API permissions code out of //chrome (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: move moar things Created 6 years, 9 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: chrome/common/extensions/permissions/media_galleries_permission_data.cc
diff --git a/chrome/common/extensions/permissions/media_galleries_permission_data.cc b/chrome/common/extensions/permissions/media_galleries_permission_data.cc
deleted file mode 100644
index fd8a9da8bd0564f325bc6069ae38f28efebf0ad6..0000000000000000000000000000000000000000
--- a/chrome/common/extensions/permissions/media_galleries_permission_data.cc
+++ /dev/null
@@ -1,62 +0,0 @@
-// Copyright (c) 2013 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.
-
-#include "chrome/common/extensions/permissions/media_galleries_permission_data.h"
-
-#include "base/strings/string_util.h"
-#include "base/values.h"
-#include "chrome/common/extensions/permissions/media_galleries_permission.h"
-
-namespace extensions {
-
-MediaGalleriesPermissionData::MediaGalleriesPermissionData() {
-}
-
-bool MediaGalleriesPermissionData::Check(
- const APIPermission::CheckParam* param) const {
- if (!param)
- return false;
-
- const MediaGalleriesPermission::CheckParam& specific_param =
- *static_cast<const MediaGalleriesPermission::CheckParam*>(param);
- return permission_ == specific_param.permission;
-}
-
-scoped_ptr<base::Value> MediaGalleriesPermissionData::ToValue() const {
- return scoped_ptr<base::Value>(new base::StringValue(permission_));
-}
-
-bool MediaGalleriesPermissionData::FromValue(const base::Value* value) {
- if (!value)
- return false;
-
- std::string raw_permission;
- if (!value->GetAsString(&raw_permission))
- return false;
-
- std::string permission;
- base::TrimWhitespaceASCII(raw_permission, base::TRIM_ALL, &permission);
-
- if (permission == MediaGalleriesPermission::kAllAutoDetectedPermission ||
- permission == MediaGalleriesPermission::kScanPermission ||
- permission == MediaGalleriesPermission::kReadPermission ||
- permission == MediaGalleriesPermission::kCopyToPermission ||
- permission == MediaGalleriesPermission::kDeletePermission) {
- permission_ = permission;
- return true;
- }
- return false;
-}
-
-bool MediaGalleriesPermissionData::operator<(
- const MediaGalleriesPermissionData& rhs) const {
- return permission_ < rhs.permission_;
-}
-
-bool MediaGalleriesPermissionData::operator==(
- const MediaGalleriesPermissionData& rhs) const {
- return permission_ == rhs.permission_;
-}
-
-} // namespace extensions

Powered by Google App Engine
This is Rietveld 408576698