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 <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/memory/ptr_util.h" | 9 #include "base/memory/ptr_util.h" |
10 #include "base/values.h" | 10 #include "base/values.h" |
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
158 ActiveInstallData* install_data) const { | 158 ActiveInstallData* install_data) const { |
159 // Default implementation sets no properties. | 159 // Default implementation sets no properties. |
160 } | 160 } |
161 | 161 |
162 void WebstoreStandaloneInstaller::OnManifestParsed() { | 162 void WebstoreStandaloneInstaller::OnManifestParsed() { |
163 ProceedWithInstallPrompt(); | 163 ProceedWithInstallPrompt(); |
164 } | 164 } |
165 | 165 |
166 std::unique_ptr<ExtensionInstallPrompt> | 166 std::unique_ptr<ExtensionInstallPrompt> |
167 WebstoreStandaloneInstaller::CreateInstallUI() { | 167 WebstoreStandaloneInstaller::CreateInstallUI() { |
168 return base::WrapUnique(new ExtensionInstallPrompt(GetWebContents())); | 168 return base::MakeUnique<ExtensionInstallPrompt>(GetWebContents()); |
169 } | 169 } |
170 | 170 |
171 std::unique_ptr<WebstoreInstaller::Approval> | 171 std::unique_ptr<WebstoreInstaller::Approval> |
172 WebstoreStandaloneInstaller::CreateApproval() const { | 172 WebstoreStandaloneInstaller::CreateApproval() const { |
173 std::unique_ptr<WebstoreInstaller::Approval> approval( | 173 std::unique_ptr<WebstoreInstaller::Approval> approval( |
174 WebstoreInstaller::Approval::CreateWithNoInstallPrompt( | 174 WebstoreInstaller::Approval::CreateWithNoInstallPrompt( |
175 profile_, id_, | 175 profile_, id_, |
176 std::unique_ptr<base::DictionaryValue>(manifest_->DeepCopy()), true)); | 176 std::unique_ptr<base::DictionaryValue>(manifest_->DeepCopy()), true)); |
177 approval->skip_post_install_ui = !ShouldShowPostInstallUI(); | 177 approval->skip_post_install_ui = !ShouldShowPostInstallUI(); |
178 approval->use_app_installed_bubble = ShouldShowAppInstalledBubble(); | 178 approval->use_app_installed_bubble = ShouldShowAppInstalledBubble(); |
(...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
410 void WebstoreStandaloneInstaller::OnWebStoreDataFetcherDone() { | 410 void WebstoreStandaloneInstaller::OnWebStoreDataFetcherDone() { |
411 // An instance of this class is passed in as a delegate for the | 411 // An instance of this class is passed in as a delegate for the |
412 // WebstoreInstallHelper, ExtensionInstallPrompt and WebstoreInstaller, and | 412 // WebstoreInstallHelper, ExtensionInstallPrompt and WebstoreInstaller, and |
413 // therefore needs to remain alive until they are done. Clear the webstore | 413 // therefore needs to remain alive until they are done. Clear the webstore |
414 // data fetcher to avoid calling Release in AbortInstall while any of these | 414 // data fetcher to avoid calling Release in AbortInstall while any of these |
415 // operations are in progress. | 415 // operations are in progress. |
416 webstore_data_fetcher_.reset(); | 416 webstore_data_fetcher_.reset(); |
417 } | 417 } |
418 | 418 |
419 } // namespace extensions | 419 } // namespace extensions |
OLD | NEW |