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

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

Issue 10704023: Moved ExtensionPrefs and related into extensions namespace (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Latest-er master merged in Created 8 years, 5 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 139 matching lines...) Expand 10 before | Expand all | Expand 10 after
150 150
151 scoped_ptr<Request::Params> params(Request::Params::Create(*args_)); 151 scoped_ptr<Request::Params> params(Request::Params::Create(*args_));
152 EXTENSION_FUNCTION_VALIDATE(params.get()); 152 EXTENSION_FUNCTION_VALIDATE(params.get());
153 153
154 requested_permissions_ = 154 requested_permissions_ =
155 helpers::UnpackPermissionSet(params->permissions, &error_); 155 helpers::UnpackPermissionSet(params->permissions, &error_);
156 if (!requested_permissions_.get()) 156 if (!requested_permissions_.get())
157 return false; 157 return false;
158 158
159 PermissionsInfo* info = PermissionsInfo::GetInstance(); 159 PermissionsInfo* info = PermissionsInfo::GetInstance();
160 ExtensionPrefs* prefs = profile()->GetExtensionService()->extension_prefs(); 160 extensions::ExtensionPrefs* prefs =
161 profile()->GetExtensionService()->extension_prefs();
161 162
162 // Make sure they're only requesting permissions supported by this API. 163 // Make sure they're only requesting permissions supported by this API.
163 APIPermissionSet apis = requested_permissions_->apis(); 164 APIPermissionSet apis = requested_permissions_->apis();
164 for (APIPermissionSet::const_iterator i = apis.begin(); 165 for (APIPermissionSet::const_iterator i = apis.begin();
165 i != apis.end(); ++i) { 166 i != apis.end(); ++i) {
166 const APIPermission* api = info->GetByID(*i); 167 const APIPermission* api = info->GetByID(*i);
167 if (!api->supports_optional()) { 168 if (!api->supports_optional()) {
168 error_ = ExtensionErrorUtils::FormatErrorMessage( 169 error_ = ExtensionErrorUtils::FormatErrorMessage(
169 kNotWhitelistedError, api->name()); 170 kNotWhitelistedError, api->name());
170 return false; 171 return false;
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
209 } else { 210 } else {
210 CHECK_EQ(DO_NOT_SKIP, auto_confirm_for_tests); 211 CHECK_EQ(DO_NOT_SKIP, auto_confirm_for_tests);
211 install_ui_.reset( 212 install_ui_.reset(
212 chrome::CreateExtensionInstallPromptWithBrowser(GetCurrentBrowser())); 213 chrome::CreateExtensionInstallPromptWithBrowser(GetCurrentBrowser()));
213 install_ui_->ConfirmPermissions( 214 install_ui_->ConfirmPermissions(
214 this, GetExtension(), requested_permissions_.get()); 215 this, GetExtension(), requested_permissions_.get());
215 } 216 }
216 217
217 return true; 218 return true;
218 } 219 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698