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 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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::WrapUnique(new 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_.get()->DeepCopy()), | 176 std::unique_ptr<base::DictionaryValue>(manifest_->DeepCopy()), true)); |
177 true)); | |
178 approval->skip_post_install_ui = !ShouldShowPostInstallUI(); | 177 approval->skip_post_install_ui = !ShouldShowPostInstallUI(); |
179 approval->use_app_installed_bubble = ShouldShowAppInstalledBubble(); | 178 approval->use_app_installed_bubble = ShouldShowAppInstalledBubble(); |
180 approval->installing_icon = gfx::ImageSkia::CreateFrom1xBitmap(icon_); | 179 approval->installing_icon = gfx::ImageSkia::CreateFrom1xBitmap(icon_); |
181 return approval; | 180 return approval; |
182 } | 181 } |
183 | 182 |
184 void WebstoreStandaloneInstaller::OnInstallPromptDone( | 183 void WebstoreStandaloneInstaller::OnInstallPromptDone( |
185 ExtensionInstallPrompt::Result result) { | 184 ExtensionInstallPrompt::Result result) { |
186 if (result == ExtensionInstallPrompt::Result::USER_CANCELED) { | 185 if (result == ExtensionInstallPrompt::Result::USER_CANCELED) { |
187 CompleteInstall(webstore_install::USER_CANCELLED, | 186 CompleteInstall(webstore_install::USER_CANCELLED, |
(...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
411 void WebstoreStandaloneInstaller::OnWebStoreDataFetcherDone() { | 410 void WebstoreStandaloneInstaller::OnWebStoreDataFetcherDone() { |
412 // 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 |
413 // WebstoreInstallHelper, ExtensionInstallPrompt and WebstoreInstaller, and | 412 // WebstoreInstallHelper, ExtensionInstallPrompt and WebstoreInstaller, and |
414 // 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 |
415 // 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 |
416 // operations are in progress. | 415 // operations are in progress. |
417 webstore_data_fetcher_.reset(); | 416 webstore_data_fetcher_.reset(); |
418 } | 417 } |
419 | 418 |
420 } // namespace extensions | 419 } // namespace extensions |
OLD | NEW |