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 <vector> | 7 #include <vector> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/string_util.h" | 10 #include "base/string_util.h" |
(...skipping 347 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
358 rating_count_); | 358 rating_count_); |
359 } | 359 } |
360 std::string error; | 360 std::string error; |
361 dummy_extension_ = ExtensionInstallPrompt::GetLocalizedExtensionForDisplay( | 361 dummy_extension_ = ExtensionInstallPrompt::GetLocalizedExtensionForDisplay( |
362 manifest, | 362 manifest, |
363 Extension::REQUIRE_KEY | Extension::FROM_WEBSTORE, | 363 Extension::REQUIRE_KEY | Extension::FROM_WEBSTORE, |
364 id_, | 364 id_, |
365 localized_name_, | 365 localized_name_, |
366 localized_description_, | 366 localized_description_, |
367 &error); | 367 &error); |
368 if (!dummy_extension_) { | 368 if (!dummy_extension_.get()) { |
369 OnWebstoreParseFailure(id_, WebstoreInstallHelper::Delegate::MANIFEST_ERROR, | 369 OnWebstoreParseFailure(id_, WebstoreInstallHelper::Delegate::MANIFEST_ERROR, |
370 kInvalidManifestError); | 370 kInvalidManifestError); |
371 return; | 371 return; |
372 } | 372 } |
373 | 373 |
374 install_ui_.reset(new ExtensionInstallPrompt(web_contents())); | 374 install_ui_.reset(new ExtensionInstallPrompt(web_contents())); |
375 install_ui_->ConfirmStandaloneInstall(this, dummy_extension_, &icon_, prompt); | 375 install_ui_-> |
| 376 ConfirmStandaloneInstall(this, dummy_extension_.get(), &icon_, prompt); |
376 // Control flow finishes up in InstallUIProceed or InstallUIAbort. | 377 // Control flow finishes up in InstallUIProceed or InstallUIAbort. |
377 } | 378 } |
378 | 379 |
379 void WebstoreStandaloneInstaller::OnWebstoreParseFailure( | 380 void WebstoreStandaloneInstaller::OnWebstoreParseFailure( |
380 const std::string& id, | 381 const std::string& id, |
381 InstallHelperResultCode result_code, | 382 InstallHelperResultCode result_code, |
382 const std::string& error_message) { | 383 const std::string& error_message) { |
383 CompleteInstall(error_message); | 384 CompleteInstall(error_message); |
384 } | 385 } |
385 | 386 |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
463 DLOG(WARNING) << "Could not parse " << verified_site_url << | 464 DLOG(WARNING) << "Could not parse " << verified_site_url << |
464 " as URL pattern " << parse_result; | 465 " as URL pattern " << parse_result; |
465 return false; | 466 return false; |
466 } | 467 } |
467 verified_site_pattern.SetScheme("*"); | 468 verified_site_pattern.SetScheme("*"); |
468 | 469 |
469 return verified_site_pattern.MatchesURL(requestor_url); | 470 return verified_site_pattern.MatchesURL(requestor_url); |
470 } | 471 } |
471 | 472 |
472 } // namespace extensions | 473 } // namespace extensions |
OLD | NEW |