| 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 362 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 373 // Check if the tab has gone away in the meantime. | 373 // Check if the tab has gone away in the meantime. |
| 374 if (!web_contents()) { | 374 if (!web_contents()) { |
| 375 CompleteInstall(""); | 375 CompleteInstall(""); |
| 376 return; | 376 return; |
| 377 } | 377 } |
| 378 | 378 |
| 379 Profile* profile = Profile::FromBrowserContext( | 379 Profile* profile = Profile::FromBrowserContext( |
| 380 web_contents()->GetBrowserContext()); | 380 web_contents()->GetBrowserContext()); |
| 381 | 381 |
| 382 scoped_ptr<WebstoreInstaller::Approval> approval( | 382 scoped_ptr<WebstoreInstaller::Approval> approval( |
| 383 new WebstoreInstaller::Approval); | 383 WebstoreInstaller::Approval::CreateWithNoInstallPrompt( |
| 384 approval->extension_id = id_; | 384 profile, |
| 385 approval->profile = profile; | 385 id_, |
| 386 approval->parsed_manifest.reset(manifest_.get()->DeepCopy()); | 386 scoped_ptr<base::DictionaryValue>(manifest_.get()->DeepCopy()))); |
| 387 approval->use_app_installed_bubble = true; | 387 approval->use_app_installed_bubble = true; |
| 388 | 388 |
| 389 scoped_refptr<WebstoreInstaller> installer = new WebstoreInstaller( | 389 scoped_refptr<WebstoreInstaller> installer = new WebstoreInstaller( |
| 390 profile, this, &(web_contents()->GetController()), id_, approval.Pass(), | 390 profile, this, &(web_contents()->GetController()), id_, approval.Pass(), |
| 391 WebstoreInstaller::FLAG_INLINE_INSTALL); | 391 WebstoreInstaller::FLAG_INLINE_INSTALL); |
| 392 installer->Start(); | 392 installer->Start(); |
| 393 } | 393 } |
| 394 | 394 |
| 395 void WebstoreInlineInstaller::InstallUIAbort(bool user_initiated) { | 395 void WebstoreInlineInstaller::InstallUIAbort(bool user_initiated) { |
| 396 CompleteInstall(kUserCancelledError); | 396 CompleteInstall(kUserCancelledError); |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 446 verified_site_pattern.Parse(verified_site_url); | 446 verified_site_pattern.Parse(verified_site_url); |
| 447 if (parse_result != URLPattern::PARSE_SUCCESS) { | 447 if (parse_result != URLPattern::PARSE_SUCCESS) { |
| 448 DLOG(WARNING) << "Could not parse " << verified_site_url << | 448 DLOG(WARNING) << "Could not parse " << verified_site_url << |
| 449 " as URL pattern " << parse_result; | 449 " as URL pattern " << parse_result; |
| 450 return false; | 450 return false; |
| 451 } | 451 } |
| 452 verified_site_pattern.SetScheme("*"); | 452 verified_site_pattern.SetScheme("*"); |
| 453 | 453 |
| 454 return verified_site_pattern.MatchesURL(requestor_url); | 454 return verified_site_pattern.MatchesURL(requestor_url); |
| 455 } | 455 } |
| OLD | NEW |