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 "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/strings/utf_string_conversions.h" | 8 #include "base/strings/utf_string_conversions.h" |
9 #include "chrome/app/chrome_command_ids.h" | 9 #include "chrome/app/chrome_command_ids.h" |
10 #include "chrome/browser/extensions/extension_service.h" | 10 #include "chrome/browser/extensions/extension_service.h" |
(...skipping 351 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
362 } | 362 } |
363 | 363 |
364 void ExternalInstallError::OnDialogReady( | 364 void ExternalInstallError::OnDialogReady( |
365 const ExtensionInstallPrompt::ShowParams& show_params, | 365 const ExtensionInstallPrompt::ShowParams& show_params, |
366 ExtensionInstallPrompt::Delegate* prompt_delegate, | 366 ExtensionInstallPrompt::Delegate* prompt_delegate, |
367 scoped_refptr<ExtensionInstallPrompt::Prompt> prompt) { | 367 scoped_refptr<ExtensionInstallPrompt::Prompt> prompt) { |
368 DCHECK_EQ(this, prompt_delegate); | 368 DCHECK_EQ(this, prompt_delegate); |
369 prompt_ = prompt; | 369 prompt_ = prompt; |
370 | 370 |
371 if (alert_type_ == BUBBLE_ALERT) { | 371 if (alert_type_ == BUBBLE_ALERT) { |
372 global_error_.reset(new ExternalInstallBubbleAlert(this, prompt_)); | 372 global_error_.reset(new ExternalInstallBubbleAlert(this, prompt_.get())); |
373 error_service_->AddGlobalError(global_error_.get()); | 373 error_service_->AddGlobalError(global_error_.get()); |
374 | 374 |
375 Browser* browser = | 375 Browser* browser = |
376 chrome::FindTabbedBrowser(Profile::FromBrowserContext(browser_context_), | 376 chrome::FindTabbedBrowser(Profile::FromBrowserContext(browser_context_), |
377 true, | 377 true, |
378 chrome::GetActiveDesktop()); | 378 chrome::GetActiveDesktop()); |
379 if (browser) | 379 if (browser) |
380 global_error_->ShowBubbleView(browser); | 380 global_error_->ShowBubbleView(browser); |
381 } else { | 381 } else { |
382 DCHECK(alert_type_ == MENU_ALERT); | 382 DCHECK(alert_type_ == MENU_ALERT); |
383 global_error_.reset(new ExternalInstallMenuAlert(this)); | 383 global_error_.reset(new ExternalInstallMenuAlert(this)); |
384 error_service_->AddGlobalError(global_error_.get()); | 384 error_service_->AddGlobalError(global_error_.get()); |
385 } | 385 } |
386 } | 386 } |
387 | 387 |
388 } // namespace extensions | 388 } // namespace extensions |
OLD | NEW |