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

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

Issue 2825963003: Rewrite base::Bind to base::BindOnce with base_bind_rewriters in //chrome/browser/extensions (Closed)
Patch Set: Created 3 years, 8 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/external_install_error.h" 5 #include "chrome/browser/extensions/external_install_error.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 306 matching lines...) Expand 10 before | Expand all | Expand 10 after
317 } 317 }
318 318
319 void ExternalInstallError::OnInstallPromptDone( 319 void ExternalInstallError::OnInstallPromptDone(
320 ExtensionInstallPrompt::Result result) { 320 ExtensionInstallPrompt::Result result) {
321 const Extension* extension = GetExtension(); 321 const Extension* extension = GetExtension();
322 322
323 // If the error isn't removed and deleted as part of handling the user's 323 // If the error isn't removed and deleted as part of handling the user's
324 // response (which can happen, e.g., if an uninstall fails), be sure to remove 324 // response (which can happen, e.g., if an uninstall fails), be sure to remove
325 // the error directly in order to ensure it's not called twice. 325 // the error directly in order to ensure it's not called twice.
326 base::ThreadTaskRunnerHandle::Get()->PostTask( 326 base::ThreadTaskRunnerHandle::Get()->PostTask(
327 FROM_HERE, base::Bind(&ExternalInstallError::RemoveError, 327 FROM_HERE, base::BindOnce(&ExternalInstallError::RemoveError,
328 weak_factory_.GetWeakPtr())); 328 weak_factory_.GetWeakPtr()));
329 329
330 switch (result) { 330 switch (result) {
331 case ExtensionInstallPrompt::Result::ACCEPTED: 331 case ExtensionInstallPrompt::Result::ACCEPTED:
332 if (extension) { 332 if (extension) {
333 ExtensionSystem::Get(browser_context_) 333 ExtensionSystem::Get(browser_context_)
334 ->extension_service() 334 ->extension_service()
335 ->GrantPermissionsAndEnableExtension(extension); 335 ->GrantPermissionsAndEnableExtension(extension);
336 } 336 }
337 break; 337 break;
338 case ExtensionInstallPrompt::Result::USER_CANCELED: 338 case ExtensionInstallPrompt::Result::USER_CANCELED:
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after
456 global_error_.reset(new ExternalInstallMenuAlert(this)); 456 global_error_.reset(new ExternalInstallMenuAlert(this));
457 error_service_->AddUnownedGlobalError(global_error_.get()); 457 error_service_->AddUnownedGlobalError(global_error_.get());
458 } 458 }
459 } 459 }
460 460
461 void ExternalInstallError::RemoveError() { 461 void ExternalInstallError::RemoveError() {
462 manager_->RemoveExternalInstallError(extension_id_); 462 manager_->RemoveExternalInstallError(extension_id_);
463 } 463 }
464 464
465 } // namespace extensions 465 } // namespace extensions
OLDNEW
« no previous file with comments | « chrome/browser/extensions/extension_web_ui.cc ('k') | chrome/browser/extensions/external_pref_loader.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698