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: Added ReloadExtensionImpl, enhanced loader handler to send ListValue of failures 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 278 matching lines...) Expand 10 before | Expand all | Expand 10 after
289 } 289 }
290 290
291 BrowserThread::PostTask( 291 BrowserThread::PostTask(
292 BrowserThread::UI, 292 BrowserThread::UI,
293 FROM_HERE, 293 FROM_HERE,
294 base::Bind(&UnpackedInstaller::ShowInstallPrompt, this)); 294 base::Bind(&UnpackedInstaller::ShowInstallPrompt, this));
295 } 295 }
296 296
297 void UnpackedInstaller::ReportExtensionLoadError(const std::string &error) { 297 void UnpackedInstaller::ReportExtensionLoadError(const std::string &error) {
298 CHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 298 CHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
299 if (!on_failure_callback_.is_null())
300 on_failure_callback_.Run(extension_path_, error);
301 299
302 if (service_weak_.get()) { 300 if (service_weak_.get()) {
303 ExtensionErrorReporter::GetInstance()->ReportLoadError( 301 ExtensionErrorReporter::GetInstance()->ReportLoadError(
304 extension_path_, 302 extension_path_,
305 error, 303 error,
306 service_weak_->profile(), 304 service_weak_->profile(),
307 be_noisy_on_failure_); 305 be_noisy_on_failure_);
308 } 306 }
309 } 307 }
310 308
311 void UnpackedInstaller::ConfirmInstall() { 309 void UnpackedInstaller::ConfirmInstall() {
312 DCHECK_CURRENTLY_ON(BrowserThread::UI); 310 DCHECK_CURRENTLY_ON(BrowserThread::UI);
313 base::string16 error = installer_.CheckManagementPolicy(); 311 base::string16 error = installer_.CheckManagementPolicy();
314 if (!error.empty()) { 312 if (!error.empty()) {
315 ReportExtensionLoadError(base::UTF16ToUTF8(error)); 313 ReportExtensionLoadError(base::UTF16ToUTF8(error));
316 return; 314 return;
317 } 315 }
318 316
319 PermissionsUpdater perms_updater(service_weak_->profile()); 317 PermissionsUpdater perms_updater(service_weak_->profile());
320 perms_updater.GrantActivePermissions(installer_.extension().get()); 318 perms_updater.GrantActivePermissions(installer_.extension().get());
321 319
322 service_weak_->OnExtensionInstalled(installer_.extension().get(), 320 service_weak_->OnExtensionInstalled(installer_.extension().get(),
323 syncer::StringOrdinal(), 321 syncer::StringOrdinal(),
324 kInstallFlagInstallImmediately); 322 kInstallFlagInstallImmediately);
325 } 323 }
326 324
327 } // namespace extensions 325 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698