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 "chrome/browser/extensions/crx_installer.h" | 8 #include "chrome/browser/extensions/crx_installer.h" |
9 #include "chrome/browser/extensions/extension_install_prompt.h" | 9 #include "chrome/browser/extensions/extension_install_prompt.h" |
10 #include "chrome/browser/extensions/extension_install_ui.h" | 10 #include "chrome/browser/extensions/extension_install_ui.h" |
(...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
226 const std::string& id, | 226 const std::string& id, |
227 const std::string& error, | 227 const std::string& error, |
228 WebstoreInstaller::FailureReason cancelled) { | 228 WebstoreInstaller::FailureReason cancelled) { |
229 CHECK_EQ(id_, id); | 229 CHECK_EQ(id_, id); |
230 CompleteInstall(error); | 230 CompleteInstall(error); |
231 } | 231 } |
232 | 232 |
233 void WebstoreStandaloneInstaller::AbortInstall() { | 233 void WebstoreStandaloneInstaller::AbortInstall() { |
234 callback_.Reset(); | 234 callback_.Reset(); |
235 // Abort any in-progress fetches. | 235 // Abort any in-progress fetches. |
236 if (webstore_data_fetcher_.get()) { | 236 if (webstore_data_fetcher_) { |
237 webstore_data_fetcher_.reset(); | 237 webstore_data_fetcher_.reset(); |
238 Release(); // Matches the AddRef in BeginInstall. | 238 Release(); // Matches the AddRef in BeginInstall. |
239 } | 239 } |
240 } | 240 } |
241 | 241 |
242 void WebstoreStandaloneInstaller::CompleteInstall(const std::string& error) { | 242 void WebstoreStandaloneInstaller::CompleteInstall(const std::string& error) { |
243 // Clear webstore_data_fetcher_ so that WebContentsDestroyed will no longer | 243 // Clear webstore_data_fetcher_ so that WebContentsDestroyed will no longer |
244 // call Release in case the WebContents is destroyed before this object. | 244 // call Release in case the WebContents is destroyed before this object. |
245 scoped_ptr<WebstoreDataFetcher> webstore_data_fetcher( | 245 scoped_ptr<WebstoreDataFetcher> webstore_data_fetcher( |
246 webstore_data_fetcher_.Pass()); | 246 webstore_data_fetcher_.Pass()); |
(...skipping 20 matching lines...) Expand all Loading... |
267 } | 267 } |
268 | 268 |
269 install_ui_.reset(new ExtensionInstallPrompt(GetWebContents())); | 269 install_ui_.reset(new ExtensionInstallPrompt(GetWebContents())); |
270 install_ui_->ConfirmStandaloneInstall(this, | 270 install_ui_->ConfirmStandaloneInstall(this, |
271 localized_extension_for_display_, | 271 localized_extension_for_display_, |
272 &icon_, | 272 &icon_, |
273 *install_prompt_); | 273 *install_prompt_); |
274 } | 274 } |
275 | 275 |
276 } // namespace extensions | 276 } // namespace extensions |
OLD | NEW |