| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/webstore_standalone_installer.h" | 5 #include "chrome/browser/extensions/webstore_standalone_installer.h" |
| 6 | 6 |
| 7 #include "base/values.h" | 7 #include "base/values.h" |
| 8 #include "base/version.h" | 8 #include "base/version.h" |
| 9 #include "chrome/browser/extensions/crx_installer.h" | 9 #include "chrome/browser/extensions/crx_installer.h" |
| 10 #include "chrome/browser/extensions/extension_install_prompt.h" | 10 #include "chrome/browser/extensions/extension_install_prompt.h" |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 80 if (webstore_data_fetcher_) { | 80 if (webstore_data_fetcher_) { |
| 81 webstore_data_fetcher_.reset(); | 81 webstore_data_fetcher_.reset(); |
| 82 Release(); // Matches the AddRef in BeginInstall. | 82 Release(); // Matches the AddRef in BeginInstall. |
| 83 } | 83 } |
| 84 } | 84 } |
| 85 | 85 |
| 86 void WebstoreStandaloneInstaller::CompleteInstall( | 86 void WebstoreStandaloneInstaller::CompleteInstall( |
| 87 webstore_install::Result result, | 87 webstore_install::Result result, |
| 88 const std::string& error) { | 88 const std::string& error) { |
| 89 if (!callback_.is_null()) | 89 if (!callback_.is_null()) |
| 90 callback_.Run(result == webstore_install::SUCCESS, error); | 90 callback_.Run(result == webstore_install::SUCCESS, error, result); |
| 91 Release(); // Matches the AddRef in BeginInstall. | 91 Release(); // Matches the AddRef in BeginInstall. |
| 92 } | 92 } |
| 93 | 93 |
| 94 void WebstoreStandaloneInstaller::ProceedWithInstallPrompt() { | 94 void WebstoreStandaloneInstaller::ProceedWithInstallPrompt() { |
| 95 install_prompt_ = CreateInstallPrompt(); | 95 install_prompt_ = CreateInstallPrompt(); |
| 96 if (install_prompt_) { | 96 if (install_prompt_) { |
| 97 ShowInstallUI(); | 97 ShowInstallUI(); |
| 98 // Control flow finishes up in InstallUIProceed or InstallUIAbort. | 98 // Control flow finishes up in InstallUIProceed or InstallUIAbort. |
| 99 } else { | 99 } else { |
| 100 InstallUIProceed(); | 100 InstallUIProceed(); |
| (...skipping 288 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 389 void WebstoreStandaloneInstaller::OnWebStoreDataFetcherDone() { | 389 void WebstoreStandaloneInstaller::OnWebStoreDataFetcherDone() { |
| 390 // An instance of this class is passed in as a delegate for the | 390 // An instance of this class is passed in as a delegate for the |
| 391 // WebstoreInstallHelper, ExtensionInstallPrompt and WebstoreInstaller, and | 391 // WebstoreInstallHelper, ExtensionInstallPrompt and WebstoreInstaller, and |
| 392 // therefore needs to remain alive until they are done. Clear the webstore | 392 // therefore needs to remain alive until they are done. Clear the webstore |
| 393 // data fetcher to avoid calling Release in AbortInstall while any of these | 393 // data fetcher to avoid calling Release in AbortInstall while any of these |
| 394 // operations are in progress. | 394 // operations are in progress. |
| 395 webstore_data_fetcher_.reset(); | 395 webstore_data_fetcher_.reset(); |
| 396 } | 396 } |
| 397 | 397 |
| 398 } // namespace extensions | 398 } // namespace extensions |
| OLD | NEW |