| 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 535 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 546 error_ = ErrorUtils::FormatErrorMessage( | 546 error_ = ErrorUtils::FormatErrorMessage( |
| 547 kNoPreviousBeginInstallWithManifestError, params->expected_id); | 547 kNoPreviousBeginInstallWithManifestError, params->expected_id); |
| 548 return false; | 548 return false; |
| 549 } | 549 } |
| 550 | 550 |
| 551 // Balanced in OnExtensionInstallSuccess() or OnExtensionInstallFailure(). | 551 // Balanced in OnExtensionInstallSuccess() or OnExtensionInstallFailure(). |
| 552 AddRef(); | 552 AddRef(); |
| 553 AppListService* app_list_service = | 553 AppListService* app_list_service = |
| 554 AppListService::Get(GetCurrentBrowser()->host_desktop_type()); | 554 AppListService::Get(GetCurrentBrowser()->host_desktop_type()); |
| 555 | 555 |
| 556 if (approval_->enable_launcher) { | 556 if (approval_->enable_launcher) |
| 557 app_list_service->EnableAppList(GetProfile(), | 557 app_list_service->EnableAppList(GetProfile()); |
| 558 AppListService::ENABLE_FOR_APP_INSTALL); | |
| 559 } | |
| 560 | 558 |
| 561 if (IsAppLauncherEnabled() && approval_->manifest->is_app()) { | 559 if (IsAppLauncherEnabled() && approval_->manifest->is_app()) { |
| 562 // Show the app list to show download is progressing. Don't show the app | 560 // Show the app list to show download is progressing. Don't show the app |
| 563 // list on first app install so users can be trained to open it themselves. | 561 // list on first app install so users can be trained to open it themselves. |
| 564 if (approval_->enable_launcher) | 562 if (approval_->enable_launcher) |
| 565 app_list_service->CreateForProfile(GetProfile()); | 563 app_list_service->CreateForProfile(GetProfile()); |
| 566 else | 564 else |
| 567 app_list_service->AutoShowForProfile(GetProfile()); | 565 app_list_service->ShowForProfile(GetProfile()); |
| 568 } | 566 } |
| 569 | 567 |
| 570 // The extension will install through the normal extension install flow, but | 568 // The extension will install through the normal extension install flow, but |
| 571 // the whitelist entry will bypass the normal permissions install dialog. | 569 // the whitelist entry will bypass the normal permissions install dialog. |
| 572 scoped_refptr<WebstoreInstaller> installer = new WebstoreInstaller( | 570 scoped_refptr<WebstoreInstaller> installer = new WebstoreInstaller( |
| 573 GetProfile(), | 571 GetProfile(), |
| 574 this, | 572 this, |
| 575 &(dispatcher()->delegate()->GetAssociatedWebContents()->GetController()), | 573 &(dispatcher()->delegate()->GetAssociatedWebContents()->GetController()), |
| 576 params->expected_id, | 574 params->expected_id, |
| 577 approval_.Pass(), | 575 approval_.Pass(), |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 616 Release(); | 614 Release(); |
| 617 } | 615 } |
| 618 | 616 |
| 619 WebstorePrivateEnableAppLauncherFunction:: | 617 WebstorePrivateEnableAppLauncherFunction:: |
| 620 WebstorePrivateEnableAppLauncherFunction() {} | 618 WebstorePrivateEnableAppLauncherFunction() {} |
| 621 | 619 |
| 622 WebstorePrivateEnableAppLauncherFunction:: | 620 WebstorePrivateEnableAppLauncherFunction:: |
| 623 ~WebstorePrivateEnableAppLauncherFunction() {} | 621 ~WebstorePrivateEnableAppLauncherFunction() {} |
| 624 | 622 |
| 625 bool WebstorePrivateEnableAppLauncherFunction::RunImpl() { | 623 bool WebstorePrivateEnableAppLauncherFunction::RunImpl() { |
| 626 AppListService::Get(GetCurrentBrowser()->host_desktop_type()) | 624 AppListService::Get(GetCurrentBrowser()->host_desktop_type())-> |
| 627 ->EnableAppList(GetProfile(), AppListService::ENABLE_VIA_WEBSTORE_LINK); | 625 EnableAppList(GetProfile()); |
| 628 return true; | 626 return true; |
| 629 } | 627 } |
| 630 | 628 |
| 631 bool WebstorePrivateGetBrowserLoginFunction::RunImpl() { | 629 bool WebstorePrivateGetBrowserLoginFunction::RunImpl() { |
| 632 GetBrowserLogin::Results::Info info; | 630 GetBrowserLogin::Results::Info info; |
| 633 info.login = GetProfile()->GetOriginalProfile()->GetPrefs()->GetString( | 631 info.login = GetProfile()->GetOriginalProfile()->GetPrefs()->GetString( |
| 634 prefs::kGoogleServicesUsername); | 632 prefs::kGoogleServicesUsername); |
| 635 results_ = GetBrowserLogin::Results::Create(info); | 633 results_ = GetBrowserLogin::Results::Create(info); |
| 636 return true; | 634 return true; |
| 637 } | 635 } |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 680 return true; | 678 return true; |
| 681 } | 679 } |
| 682 | 680 |
| 683 bool WebstorePrivateIsInIncognitoModeFunction::RunImpl() { | 681 bool WebstorePrivateIsInIncognitoModeFunction::RunImpl() { |
| 684 results_ = IsInIncognitoMode::Results::Create( | 682 results_ = IsInIncognitoMode::Results::Create( |
| 685 GetProfile() != GetProfile()->GetOriginalProfile()); | 683 GetProfile() != GetProfile()->GetOriginalProfile()); |
| 686 return true; | 684 return true; |
| 687 } | 685 } |
| 688 | 686 |
| 689 } // namespace extensions | 687 } // namespace extensions |
| OLD | NEW |