OLD | NEW |
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 404 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
415 void ExternalInstallError::OnDialogReady( | 415 void ExternalInstallError::OnDialogReady( |
416 ExtensionInstallPromptShowParams* show_params, | 416 ExtensionInstallPromptShowParams* show_params, |
417 const ExtensionInstallPrompt::DoneCallback& callback, | 417 const ExtensionInstallPrompt::DoneCallback& callback, |
418 scoped_ptr<ExtensionInstallPrompt::Prompt> prompt) { | 418 scoped_ptr<ExtensionInstallPrompt::Prompt> prompt) { |
419 prompt_ = std::move(prompt); | 419 prompt_ = std::move(prompt); |
420 | 420 |
421 if (alert_type_ == BUBBLE_ALERT) { | 421 if (alert_type_ == BUBBLE_ALERT) { |
422 global_error_.reset(new ExternalInstallBubbleAlert(this, prompt_.get())); | 422 global_error_.reset(new ExternalInstallBubbleAlert(this, prompt_.get())); |
423 error_service_->AddGlobalError(global_error_.get()); | 423 error_service_->AddGlobalError(global_error_.get()); |
424 | 424 |
425 Browser* browser = | 425 Browser* browser = chrome::FindTabbedBrowser( |
426 chrome::FindTabbedBrowser(Profile::FromBrowserContext(browser_context_), | 426 Profile::FromBrowserContext(browser_context_), true); |
427 true, | |
428 chrome::GetActiveDesktop()); | |
429 if (browser) | 427 if (browser) |
430 global_error_->ShowBubbleView(browser); | 428 global_error_->ShowBubbleView(browser); |
431 } else { | 429 } else { |
432 DCHECK(alert_type_ == MENU_ALERT); | 430 DCHECK(alert_type_ == MENU_ALERT); |
433 global_error_.reset(new ExternalInstallMenuAlert(this)); | 431 global_error_.reset(new ExternalInstallMenuAlert(this)); |
434 error_service_->AddGlobalError(global_error_.get()); | 432 error_service_->AddGlobalError(global_error_.get()); |
435 } | 433 } |
436 } | 434 } |
437 | 435 |
438 void ExternalInstallError::RemoveError() { | 436 void ExternalInstallError::RemoveError() { |
439 manager_->RemoveExternalInstallError(extension_id_); | 437 manager_->RemoveExternalInstallError(extension_id_); |
440 } | 438 } |
441 | 439 |
442 } // namespace extensions | 440 } // namespace extensions |
OLD | NEW |