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

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

Issue 342003005: Show alert failure for reloading unpacked extensions with bad manifest (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Prettified failure path Created 6 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) 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/command_line.h" 9 #include "base/command_line.h"
10 #include "base/file_util.h" 10 #include "base/file_util.h"
(...skipping 281 matching lines...) Expand 10 before | Expand all | Expand 10 after
292 } 292 }
293 293
294 BrowserThread::PostTask( 294 BrowserThread::PostTask(
295 BrowserThread::UI, 295 BrowserThread::UI,
296 FROM_HERE, 296 FROM_HERE,
297 base::Bind(&UnpackedInstaller::ShowInstallPrompt, this)); 297 base::Bind(&UnpackedInstaller::ShowInstallPrompt, this));
298 } 298 }
299 299
300 void UnpackedInstaller::ReportExtensionLoadError(const std::string &error) { 300 void UnpackedInstaller::ReportExtensionLoadError(const std::string &error) {
301 CHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 301 CHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
302 if (!on_failure_callback_.is_null())
303 on_failure_callback_.Run(extension_path_, error);
304 302
305 if (service_weak_.get()) { 303 if (service_weak_.get()) {
306 ExtensionErrorReporter::GetInstance()->ReportLoadError( 304 ExtensionErrorReporter::GetInstance()->ReportLoadError(
307 extension_path_, 305 extension_path_,
308 error, 306 error,
309 service_weak_->profile(), 307 service_weak_->profile(),
310 be_noisy_on_failure_); 308 be_noisy_on_failure_);
311 } 309 }
312 } 310 }
313 311
314 void UnpackedInstaller::InstallExtension() { 312 void UnpackedInstaller::InstallExtension() {
315 DCHECK_CURRENTLY_ON(BrowserThread::UI); 313 DCHECK_CURRENTLY_ON(BrowserThread::UI);
316 314
317 PermissionsUpdater perms_updater(service_weak_->profile()); 315 PermissionsUpdater perms_updater(service_weak_->profile());
318 perms_updater.GrantActivePermissions(extension()); 316 perms_updater.GrantActivePermissions(extension());
319 317
320 service_weak_->OnExtensionInstalled( 318 service_weak_->OnExtensionInstalled(
321 extension(), syncer::StringOrdinal(), kInstallFlagInstallImmediately); 319 extension(), syncer::StringOrdinal(), kInstallFlagInstallImmediately);
322 } 320 }
323 321
324 } // namespace extensions 322 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698