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