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 325 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
336 // Check if the tab has gone away in the meantime. | 336 // Check if the tab has gone away in the meantime. |
337 if (!web_contents()) { | 337 if (!web_contents()) { |
338 CompleteInstall(""); | 338 CompleteInstall(""); |
339 return; | 339 return; |
340 } | 340 } |
341 | 341 |
342 CHECK_EQ(id_, id); | 342 CHECK_EQ(id_, id); |
343 manifest_.reset(manifest); | 343 manifest_.reset(manifest); |
344 icon_ = icon; | 344 icon_ = icon; |
345 | 345 |
| 346 Profile* profile = Profile::FromBrowserContext( |
| 347 web_contents()->GetBrowserContext()); |
346 ExtensionInstallPrompt::Prompt prompt( | 348 ExtensionInstallPrompt::Prompt prompt( |
| 349 profile, |
347 ExtensionInstallPrompt::INLINE_INSTALL_PROMPT); | 350 ExtensionInstallPrompt::INLINE_INSTALL_PROMPT); |
348 prompt.SetInlineInstallWebstoreData(localized_user_count_, | 351 prompt.SetInlineInstallWebstoreData(localized_user_count_, |
349 average_rating_, | 352 average_rating_, |
350 rating_count_); | 353 rating_count_); |
351 std::string error; | 354 std::string error; |
352 dummy_extension_ = ExtensionInstallPrompt::GetLocalizedExtensionForDisplay( | 355 dummy_extension_ = ExtensionInstallPrompt::GetLocalizedExtensionForDisplay( |
353 manifest, | 356 manifest, |
354 Extension::REQUIRE_KEY | Extension::FROM_WEBSTORE, | 357 Extension::REQUIRE_KEY | Extension::FROM_WEBSTORE, |
355 id_, | 358 id_, |
356 localized_name_, | 359 localized_name_, |
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
454 DLOG(WARNING) << "Could not parse " << verified_site_url << | 457 DLOG(WARNING) << "Could not parse " << verified_site_url << |
455 " as URL pattern " << parse_result; | 458 " as URL pattern " << parse_result; |
456 return false; | 459 return false; |
457 } | 460 } |
458 verified_site_pattern.SetScheme("*"); | 461 verified_site_pattern.SetScheme("*"); |
459 | 462 |
460 return verified_site_pattern.MatchesURL(requestor_url); | 463 return verified_site_pattern.MatchesURL(requestor_url); |
461 } | 464 } |
462 | 465 |
463 } // namespace extensions | 466 } // namespace extensions |
OLD | NEW |