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

Side by Side Diff: chrome/browser/extensions/api/permissions/permissions_api.cc

Issue 10375021: Move Extension into extensions namespace (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Take 6 Created 8 years, 7 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/extensions/api/permissions/permissions_api.h" 5 #include "chrome/browser/extensions/api/permissions/permissions_api.h"
6 6
7 #include "base/memory/scoped_ptr.h" 7 #include "base/memory/scoped_ptr.h"
8 #include "chrome/browser/extensions/api/permissions/permissions_api_helpers.h" 8 #include "chrome/browser/extensions/api/permissions/permissions_api_helpers.h"
9 #include "chrome/browser/extensions/extension_service.h" 9 #include "chrome/browser/extensions/extension_service.h"
10 #include "chrome/browser/extensions/permissions_updater.h" 10 #include "chrome/browser/extensions/permissions_updater.h"
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
68 68
69 bool RemovePermissionsFunction::RunImpl() { 69 bool RemovePermissionsFunction::RunImpl() {
70 scoped_ptr<Remove::Params> params(Remove::Params::Create(*args_)); 70 scoped_ptr<Remove::Params> params(Remove::Params::Create(*args_));
71 EXTENSION_FUNCTION_VALIDATE(params.get()); 71 EXTENSION_FUNCTION_VALIDATE(params.get());
72 72
73 scoped_refptr<ExtensionPermissionSet> permissions = 73 scoped_refptr<ExtensionPermissionSet> permissions =
74 helpers::UnpackPermissionSet(params->permissions, &error_); 74 helpers::UnpackPermissionSet(params->permissions, &error_);
75 if (!permissions.get()) 75 if (!permissions.get())
76 return false; 76 return false;
77 77
78 const Extension* extension = GetExtension(); 78 const extensions::Extension* extension = GetExtension();
79 ExtensionPermissionsInfo* info = ExtensionPermissionsInfo::GetInstance(); 79 ExtensionPermissionsInfo* info = ExtensionPermissionsInfo::GetInstance();
80 80
81 // Make sure they're only trying to remove permissions supported by this API. 81 // Make sure they're only trying to remove permissions supported by this API.
82 ExtensionAPIPermissionSet apis = permissions->apis(); 82 ExtensionAPIPermissionSet apis = permissions->apis();
83 for (ExtensionAPIPermissionSet::const_iterator i = apis.begin(); 83 for (ExtensionAPIPermissionSet::const_iterator i = apis.begin();
84 i != apis.end(); ++i) { 84 i != apis.end(); ++i) {
85 const ExtensionAPIPermission* api = info->GetByID(*i); 85 const ExtensionAPIPermission* api = info->GetByID(*i);
86 if (!api->supports_optional()) { 86 if (!api->supports_optional()) {
87 error_ = ExtensionErrorUtils::FormatErrorMessage( 87 error_ = ExtensionErrorUtils::FormatErrorMessage(
88 kNotWhitelistedError, api->name()); 88 kNotWhitelistedError, api->name());
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
203 InstallUIAbort(true); 203 InstallUIAbort(true);
204 } else { 204 } else {
205 CHECK_EQ(DO_NOT_SKIP, auto_confirm_for_tests); 205 CHECK_EQ(DO_NOT_SKIP, auto_confirm_for_tests);
206 install_ui_.reset(new ExtensionInstallUI(profile())); 206 install_ui_.reset(new ExtensionInstallUI(profile()));
207 install_ui_->ConfirmPermissions( 207 install_ui_->ConfirmPermissions(
208 this, GetExtension(), requested_permissions_.get()); 208 this, GetExtension(), requested_permissions_.get());
209 } 209 }
210 210
211 return true; 211 return true;
212 } 212 }
OLDNEW
« no previous file with comments | « chrome/browser/extensions/api/permissions/permissions_api.h ('k') | chrome/browser/extensions/api/runtime/runtime_api.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698