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 348 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
359 const std::string& error) { | 359 const std::string& error) { |
360 OnFetchComplete(); | 360 OnFetchComplete(); |
361 } | 361 } |
362 | 362 |
363 void ExternalInstallError::OnFetchComplete() { | 363 void ExternalInstallError::OnFetchComplete() { |
364 // Create a new ExtensionInstallPrompt. We pass in NULL for the UI | 364 // Create a new ExtensionInstallPrompt. We pass in NULL for the UI |
365 // components because we display at a later point, and don't want | 365 // components because we display at a later point, and don't want |
366 // to pass ones which may be invalidated. | 366 // to pass ones which may be invalidated. |
367 install_ui_.reset( | 367 install_ui_.reset( |
368 new ExtensionInstallPrompt(Profile::FromBrowserContext(browser_context_), | 368 new ExtensionInstallPrompt(Profile::FromBrowserContext(browser_context_), |
369 NULL, // NULL native window. | 369 NULL)); // NULL native window. |
370 NULL)); // NULL navigator. | |
371 | 370 |
372 install_ui_->ConfirmExternalInstall( | 371 install_ui_->ConfirmExternalInstall( |
373 this, | 372 this, |
374 GetExtension(), | 373 GetExtension(), |
375 base::Bind(&ExternalInstallError::OnDialogReady, | 374 base::Bind(&ExternalInstallError::OnDialogReady, |
376 weak_factory_.GetWeakPtr()), | 375 weak_factory_.GetWeakPtr()), |
377 prompt_); | 376 prompt_); |
378 } | 377 } |
379 | 378 |
380 void ExternalInstallError::OnDialogReady( | 379 void ExternalInstallError::OnDialogReady( |
(...skipping 14 matching lines...) Expand all Loading... |
395 if (browser) | 394 if (browser) |
396 global_error_->ShowBubbleView(browser); | 395 global_error_->ShowBubbleView(browser); |
397 } else { | 396 } else { |
398 DCHECK(alert_type_ == MENU_ALERT); | 397 DCHECK(alert_type_ == MENU_ALERT); |
399 global_error_.reset(new ExternalInstallMenuAlert(this)); | 398 global_error_.reset(new ExternalInstallMenuAlert(this)); |
400 error_service_->AddGlobalError(global_error_.get()); | 399 error_service_->AddGlobalError(global_error_.get()); |
401 } | 400 } |
402 } | 401 } |
403 | 402 |
404 } // namespace extensions | 403 } // namespace extensions |
OLD | NEW |