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

Side by Side Diff: chrome/browser/extensions/bundle_installer.cc

Issue 309533007: Refactor PermissionsData pt1 (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 6 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 | Annotate | Revision Log
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/bundle_installer.h" 5 #include "chrome/browser/extensions/bundle_installer.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after
251 // Abort if we couldn't create any Extensions out of the manifests. 251 // Abort if we couldn't create any Extensions out of the manifests.
252 if (dummy_extensions_.empty()) { 252 if (dummy_extensions_.empty()) {
253 ReportCanceled(false); 253 ReportCanceled(false);
254 return; 254 return;
255 } 255 }
256 256
257 scoped_refptr<PermissionSet> permissions; 257 scoped_refptr<PermissionSet> permissions;
258 for (size_t i = 0; i < dummy_extensions_.size(); ++i) { 258 for (size_t i = 0; i < dummy_extensions_.size(); ++i) {
259 permissions = PermissionSet::CreateUnion( 259 permissions = PermissionSet::CreateUnion(
260 permissions.get(), 260 permissions.get(),
261 PermissionsData::GetRequiredPermissions(dummy_extensions_[i].get())); 261 PermissionsData::ForExtension(dummy_extensions_[i])
262 ->active_permissions());
262 } 263 }
263 264
264 if (g_auto_approve_for_test == PROCEED) { 265 if (g_auto_approve_for_test == PROCEED) {
265 InstallUIProceed(); 266 InstallUIProceed();
266 } else if (g_auto_approve_for_test == ABORT) { 267 } else if (g_auto_approve_for_test == ABORT) {
267 InstallUIAbort(true); 268 InstallUIAbort(true);
268 } else { 269 } else {
269 Browser* browser = browser_; 270 Browser* browser = browser_;
270 if (!browser) { 271 if (!browser) {
271 // The browser that we got initially could have gone away during our 272 // The browser that we got initially could have gone away during our
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
345 void BundleInstaller::OnBrowserAdded(Browser* browser) {} 346 void BundleInstaller::OnBrowserAdded(Browser* browser) {}
346 347
347 void BundleInstaller::OnBrowserRemoved(Browser* browser) { 348 void BundleInstaller::OnBrowserRemoved(Browser* browser) {
348 if (browser_ == browser) 349 if (browser_ == browser)
349 browser_ = NULL; 350 browser_ = NULL;
350 } 351 }
351 352
352 void BundleInstaller::OnBrowserSetLastActive(Browser* browser) {} 353 void BundleInstaller::OnBrowserSetLastActive(Browser* browser) {}
353 354
354 } // namespace extensions 355 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698