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

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

Issue 979453002: [Extensions] Make chrome://extensions use developerPrivate for unpacked loading (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Comments Created 5 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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/unpacked_installer.h" 5 #include "chrome/browser/extensions/unpacked_installer.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/callback.h" 8 #include "base/callback.h"
9 #include "base/files/file_util.h" 9 #include "base/files/file_util.h"
10 #include "base/strings/string_util.h" 10 #include "base/strings/string_util.h"
(...skipping 332 matching lines...) Expand 10 before | Expand all | Expand 10 after
343 void UnpackedInstaller::ReportExtensionLoadError(const std::string &error) { 343 void UnpackedInstaller::ReportExtensionLoadError(const std::string &error) {
344 DCHECK_CURRENTLY_ON(BrowserThread::UI); 344 DCHECK_CURRENTLY_ON(BrowserThread::UI);
345 345
346 if (service_weak_.get()) { 346 if (service_weak_.get()) {
347 ExtensionErrorReporter::GetInstance()->ReportLoadError( 347 ExtensionErrorReporter::GetInstance()->ReportLoadError(
348 extension_path_, 348 extension_path_,
349 error, 349 error,
350 service_weak_->profile(), 350 service_weak_->profile(),
351 be_noisy_on_failure_); 351 be_noisy_on_failure_);
352 } 352 }
353
354 if (!callback_.is_null()) {
355 callback_.Run(nullptr, extension_path_, error);
356 callback_.Reset();
357 }
353 } 358 }
354 359
355 void UnpackedInstaller::InstallExtension() { 360 void UnpackedInstaller::InstallExtension() {
356 DCHECK_CURRENTLY_ON(BrowserThread::UI); 361 DCHECK_CURRENTLY_ON(BrowserThread::UI);
357 362
358 PermissionsUpdater perms_updater(service_weak_->profile()); 363 PermissionsUpdater perms_updater(service_weak_->profile());
359 perms_updater.InitializePermissions(extension()); 364 perms_updater.InitializePermissions(extension());
360 perms_updater.GrantActivePermissions(extension()); 365 perms_updater.GrantActivePermissions(extension());
361 366
362 service_weak_->OnExtensionInstalled( 367 service_weak_->OnExtensionInstalled(
363 extension(), syncer::StringOrdinal(), kInstallFlagInstallImmediately); 368 extension(), syncer::StringOrdinal(), kInstallFlagInstallImmediately);
369
370 if (!callback_.is_null()) {
371 callback_.Run(extension(), extension_path_, std::string());
372 callback_.Reset();
373 }
364 } 374 }
365 375
366 } // namespace extensions 376 } // namespace extensions
OLDNEW
« no previous file with comments | « chrome/browser/extensions/unpacked_installer.h ('k') | chrome/browser/resources/extensions/extension_loader.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698