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 333 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
344 manifest_.reset(manifest); | 344 manifest_.reset(manifest); |
345 icon_ = icon; | 345 icon_ = icon; |
346 | 346 |
347 ExtensionInstallPrompt::Prompt prompt( | 347 ExtensionInstallPrompt::Prompt prompt( |
348 ExtensionInstallPrompt::INLINE_INSTALL_PROMPT); | 348 ExtensionInstallPrompt::INLINE_INSTALL_PROMPT); |
349 prompt.SetInlineInstallWebstoreData(localized_user_count_, | 349 prompt.SetInlineInstallWebstoreData(localized_user_count_, |
350 average_rating_, | 350 average_rating_, |
351 rating_count_); | 351 rating_count_); |
352 std::string error; | 352 std::string error; |
353 dummy_extension_ = ExtensionInstallPrompt::GetLocalizedExtensionForDisplay( | 353 dummy_extension_ = ExtensionInstallPrompt::GetLocalizedExtensionForDisplay( |
354 manifest, id_, localized_name_, localized_description_, &error); | 354 manifest, |
| 355 Extension::FROM_WEBSTORE, |
| 356 id_, |
| 357 localized_name_, |
| 358 localized_description_, |
| 359 &error); |
355 if (!dummy_extension_) { | 360 if (!dummy_extension_) { |
356 OnWebstoreParseFailure(id_, WebstoreInstallHelper::Delegate::MANIFEST_ERROR, | 361 OnWebstoreParseFailure(id_, WebstoreInstallHelper::Delegate::MANIFEST_ERROR, |
357 kInvalidManifestError); | 362 kInvalidManifestError); |
358 return; | 363 return; |
359 } | 364 } |
360 | 365 |
361 install_ui_.reset( | 366 install_ui_.reset( |
362 ExtensionInstallUI::CreateInstallPromptWithWebContents(web_contents())); | 367 ExtensionInstallUI::CreateInstallPromptWithWebContents(web_contents())); |
363 install_ui_->ConfirmInlineInstall(this, dummy_extension_, &icon_, prompt); | 368 install_ui_->ConfirmInlineInstall(this, dummy_extension_, &icon_, prompt); |
364 // Control flow finishes up in InstallUIProceed or InstallUIAbort. | 369 // Control flow finishes up in InstallUIProceed or InstallUIAbort. |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
450 DLOG(WARNING) << "Could not parse " << verified_site_url << | 455 DLOG(WARNING) << "Could not parse " << verified_site_url << |
451 " as URL pattern " << parse_result; | 456 " as URL pattern " << parse_result; |
452 return false; | 457 return false; |
453 } | 458 } |
454 verified_site_pattern.SetScheme("*"); | 459 verified_site_pattern.SetScheme("*"); |
455 | 460 |
456 return verified_site_pattern.MatchesURL(requestor_url); | 461 return verified_site_pattern.MatchesURL(requestor_url); |
457 } | 462 } |
458 | 463 |
459 } // namespace extensions | 464 } // namespace extensions |
OLD | NEW |