| 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/api/webstore_private/webstore_private_api.h" | 5 #include "chrome/browser/extensions/api/webstore_private/webstore_private_api.h" |
| 6 | 6 |
| 7 #include "base/bind_helpers.h" | 7 #include "base/bind_helpers.h" |
| 8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
| 9 #include "base/lazy_instance.h" | 9 #include "base/lazy_instance.h" |
| 10 #include "base/memory/scoped_vector.h" | 10 #include "base/memory/scoped_vector.h" |
| (...skipping 431 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 442 // Matches the AddRef in RunImpl(). | 442 // Matches the AddRef in RunImpl(). |
| 443 Release(); | 443 Release(); |
| 444 } | 444 } |
| 445 | 445 |
| 446 void WebstorePrivateBeginInstallWithManifest3Function::SigninSuccess() { | 446 void WebstorePrivateBeginInstallWithManifest3Function::SigninSuccess() { |
| 447 signin_tracker_.reset(); | 447 signin_tracker_.reset(); |
| 448 | 448 |
| 449 SigninCompletedOrNotNeeded(); | 449 SigninCompletedOrNotNeeded(); |
| 450 } | 450 } |
| 451 | 451 |
| 452 void WebstorePrivateBeginInstallWithManifest3Function::MergeSessionComplete( |
| 453 const GoogleServiceAuthError& error) { |
| 454 // TODO(rogerta): once the embeded inline flow is enabled, the code in |
| 455 // WebstorePrivateBeginInstallWithManifest3Function::SigninSuccess() |
| 456 // should move to here. |
| 457 } |
| 458 |
| 452 void WebstorePrivateBeginInstallWithManifest3Function:: | 459 void WebstorePrivateBeginInstallWithManifest3Function:: |
| 453 SigninCompletedOrNotNeeded() { | 460 SigninCompletedOrNotNeeded() { |
| 454 content::WebContents* web_contents = GetAssociatedWebContents(); | 461 content::WebContents* web_contents = GetAssociatedWebContents(); |
| 455 if (!web_contents) // The browser window has gone away. | 462 if (!web_contents) // The browser window has gone away. |
| 456 return; | 463 return; |
| 457 install_prompt_.reset(new ExtensionInstallPrompt(web_contents)); | 464 install_prompt_.reset(new ExtensionInstallPrompt(web_contents)); |
| 458 install_prompt_->ConfirmWebstoreInstall( | 465 install_prompt_->ConfirmWebstoreInstall( |
| 459 this, | 466 this, |
| 460 dummy_extension_.get(), | 467 dummy_extension_.get(), |
| 461 &icon_, | 468 &icon_, |
| (...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 571 installer->Start(); | 578 installer->Start(); |
| 572 | 579 |
| 573 return true; | 580 return true; |
| 574 } | 581 } |
| 575 | 582 |
| 576 void WebstorePrivateCompleteInstallFunction::OnExtensionInstallSuccess( | 583 void WebstorePrivateCompleteInstallFunction::OnExtensionInstallSuccess( |
| 577 const std::string& id) { | 584 const std::string& id) { |
| 578 if (test_webstore_installer_delegate) | 585 if (test_webstore_installer_delegate) |
| 579 test_webstore_installer_delegate->OnExtensionInstallSuccess(id); | 586 test_webstore_installer_delegate->OnExtensionInstallSuccess(id); |
| 580 | 587 |
| 581 LOG(INFO) << "Install success, sending response"; | 588 VLOG(1) << "Install success, sending response"; |
| 582 g_pending_installs.Get().EraseInstall(GetProfile(), id); | 589 g_pending_installs.Get().EraseInstall(GetProfile(), id); |
| 583 SendResponse(true); | 590 SendResponse(true); |
| 584 | 591 |
| 585 RecordWebstoreExtensionInstallResult(true); | 592 RecordWebstoreExtensionInstallResult(true); |
| 586 | 593 |
| 587 // Matches the AddRef in RunImpl(). | 594 // Matches the AddRef in RunImpl(). |
| 588 Release(); | 595 Release(); |
| 589 } | 596 } |
| 590 | 597 |
| 591 void WebstorePrivateCompleteInstallFunction::OnExtensionInstallFailure( | 598 void WebstorePrivateCompleteInstallFunction::OnExtensionInstallFailure( |
| 592 const std::string& id, | 599 const std::string& id, |
| 593 const std::string& error, | 600 const std::string& error, |
| 594 WebstoreInstaller::FailureReason reason) { | 601 WebstoreInstaller::FailureReason reason) { |
| 595 if (test_webstore_installer_delegate) { | 602 if (test_webstore_installer_delegate) { |
| 596 test_webstore_installer_delegate->OnExtensionInstallFailure( | 603 test_webstore_installer_delegate->OnExtensionInstallFailure( |
| 597 id, error, reason); | 604 id, error, reason); |
| 598 } | 605 } |
| 599 | 606 |
| 600 error_ = error; | 607 error_ = error; |
| 601 LOG(INFO) << "Install failed, sending response"; | 608 VLOG(1) << "Install failed, sending response"; |
| 602 g_pending_installs.Get().EraseInstall(GetProfile(), id); | 609 g_pending_installs.Get().EraseInstall(GetProfile(), id); |
| 603 SendResponse(false); | 610 SendResponse(false); |
| 604 | 611 |
| 605 RecordWebstoreExtensionInstallResult(false); | 612 RecordWebstoreExtensionInstallResult(false); |
| 606 | 613 |
| 607 // Matches the AddRef in RunImpl(). | 614 // Matches the AddRef in RunImpl(). |
| 608 Release(); | 615 Release(); |
| 609 } | 616 } |
| 610 | 617 |
| 611 WebstorePrivateEnableAppLauncherFunction:: | 618 WebstorePrivateEnableAppLauncherFunction:: |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 672 return true; | 679 return true; |
| 673 } | 680 } |
| 674 | 681 |
| 675 bool WebstorePrivateIsInIncognitoModeFunction::RunImpl() { | 682 bool WebstorePrivateIsInIncognitoModeFunction::RunImpl() { |
| 676 results_ = IsInIncognitoMode::Results::Create( | 683 results_ = IsInIncognitoMode::Results::Create( |
| 677 GetProfile() != GetProfile()->GetOriginalProfile()); | 684 GetProfile() != GetProfile()->GetOriginalProfile()); |
| 678 return true; | 685 return true; |
| 679 } | 686 } |
| 680 | 687 |
| 681 } // namespace extensions | 688 } // namespace extensions |
| OLD | NEW |