| 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_inline_installer.h" | 5 #include "chrome/browser/extensions/webstore_inline_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 341 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 352 rating_count_); | 352 rating_count_); |
| 353 std::string error; | 353 std::string error; |
| 354 dummy_extension_ = ExtensionInstallPrompt::GetLocalizedExtensionForDisplay( | 354 dummy_extension_ = ExtensionInstallPrompt::GetLocalizedExtensionForDisplay( |
| 355 manifest, id_, localized_name_, localized_description_, &error); | 355 manifest, id_, localized_name_, localized_description_, &error); |
| 356 if (!dummy_extension_) { | 356 if (!dummy_extension_) { |
| 357 OnWebstoreParseFailure(id_, WebstoreInstallHelper::Delegate::MANIFEST_ERROR, | 357 OnWebstoreParseFailure(id_, WebstoreInstallHelper::Delegate::MANIFEST_ERROR, |
| 358 kInvalidManifestError); | 358 kInvalidManifestError); |
| 359 return; | 359 return; |
| 360 } | 360 } |
| 361 | 361 |
| 362 install_ui_.reset(new ExtensionInstallPrompt(browser)); | 362 install_ui_.reset(chrome::CreateExtensionInstallPromptWithBrowser(browser)); |
| 363 install_ui_->ConfirmInlineInstall(this, dummy_extension_, &icon_, prompt); | 363 install_ui_->ConfirmInlineInstall(this, dummy_extension_, &icon_, prompt); |
| 364 // Control flow finishes up in InstallUIProceed or InstallUIAbort. | 364 // Control flow finishes up in InstallUIProceed or InstallUIAbort. |
| 365 } | 365 } |
| 366 | 366 |
| 367 void WebstoreInlineInstaller::OnWebstoreParseFailure( | 367 void WebstoreInlineInstaller::OnWebstoreParseFailure( |
| 368 const std::string& id, | 368 const std::string& id, |
| 369 InstallHelperResultCode result_code, | 369 InstallHelperResultCode result_code, |
| 370 const std::string& error_message) { | 370 const std::string& error_message) { |
| 371 CompleteInstall(error_message); | 371 CompleteInstall(error_message); |
| 372 } | 372 } |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 448 verified_site_pattern.Parse(verified_site_url); | 448 verified_site_pattern.Parse(verified_site_url); |
| 449 if (parse_result != URLPattern::PARSE_SUCCESS) { | 449 if (parse_result != URLPattern::PARSE_SUCCESS) { |
| 450 DLOG(WARNING) << "Could not parse " << verified_site_url << | 450 DLOG(WARNING) << "Could not parse " << verified_site_url << |
| 451 " as URL pattern " << parse_result; | 451 " as URL pattern " << parse_result; |
| 452 return false; | 452 return false; |
| 453 } | 453 } |
| 454 verified_site_pattern.SetScheme("*"); | 454 verified_site_pattern.SetScheme("*"); |
| 455 | 455 |
| 456 return verified_site_pattern.MatchesURL(requestor_url); | 456 return verified_site_pattern.MatchesURL(requestor_url); |
| 457 } | 457 } |
| OLD | NEW |