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 297 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
308 | 308 |
309 // Assume ownership of webstore_data. | 309 // Assume ownership of webstore_data. |
310 webstore_data_ = std::move(webstore_data); | 310 webstore_data_ = std::move(webstore_data); |
311 | 311 |
312 scoped_refptr<WebstoreInstallHelper> helper = | 312 scoped_refptr<WebstoreInstallHelper> helper = |
313 new WebstoreInstallHelper(this, | 313 new WebstoreInstallHelper(this, |
314 id_, | 314 id_, |
315 manifest, | 315 manifest, |
316 icon_url, | 316 icon_url, |
317 profile_->GetRequestContext()); | 317 profile_->GetRequestContext()); |
318 // The helper will call us back via OnWebstoreParseSucces or | 318 // The helper will call us back via OnWebstoreParseSuccess() or |
319 // OnWebstoreParseFailure. | 319 // OnWebstoreParseFailure(). |
320 helper->Start(); | 320 helper->Start(); |
321 } | 321 } |
322 | 322 |
323 void WebstoreStandaloneInstaller::OnWebstoreResponseParseFailure( | 323 void WebstoreStandaloneInstaller::OnWebstoreResponseParseFailure( |
324 const std::string& error) { | 324 const std::string& error) { |
325 OnWebStoreDataFetcherDone(); | 325 OnWebStoreDataFetcherDone(); |
326 CompleteInstall(webstore_install::INVALID_WEBSTORE_RESPONSE, error); | 326 CompleteInstall(webstore_install::INVALID_WEBSTORE_RESPONSE, error); |
327 } | 327 } |
328 | 328 |
329 void WebstoreStandaloneInstaller::OnWebstoreParseSuccess( | 329 void WebstoreStandaloneInstaller::OnWebstoreParseSuccess( |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
409 void WebstoreStandaloneInstaller::OnWebStoreDataFetcherDone() { | 409 void WebstoreStandaloneInstaller::OnWebStoreDataFetcherDone() { |
410 // An instance of this class is passed in as a delegate for the | 410 // An instance of this class is passed in as a delegate for the |
411 // WebstoreInstallHelper, ExtensionInstallPrompt and WebstoreInstaller, and | 411 // WebstoreInstallHelper, ExtensionInstallPrompt and WebstoreInstaller, and |
412 // therefore needs to remain alive until they are done. Clear the webstore | 412 // therefore needs to remain alive until they are done. Clear the webstore |
413 // data fetcher to avoid calling Release in AbortInstall while any of these | 413 // data fetcher to avoid calling Release in AbortInstall while any of these |
414 // operations are in progress. | 414 // operations are in progress. |
415 webstore_data_fetcher_.reset(); | 415 webstore_data_fetcher_.reset(); |
416 } | 416 } |
417 | 417 |
418 } // namespace extensions | 418 } // namespace extensions |
OLD | NEW |