summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorcalamity@chromium.org <calamity@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-07-08 09:24:50 +0000
committercalamity@chromium.org <calamity@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-07-08 09:24:50 +0000
commit187352d76037f0d6114e8ae029e97d42e0278798 (patch)
treea552c15140433a04bd114e86d0d7a4883d514fe3
parent1fb12e115a08f468e5c4379f634219b0c00a2ef8 (diff)
downloadchromium_src-187352d76037f0d6114e8ae029e97d42e0278798.zip
chromium_src-187352d76037f0d6114e8ae029e97d42e0278798.tar.gz
chromium_src-187352d76037f0d6114e8ae029e97d42e0278798.tar.bz2
Clean up app launcher enable code in webstore_private_api.
Review URL: https://chromiumcodereview.appspot.com/18305005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@210361 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/browser/extensions/api/webstore_private/webstore_private_api.cc38
-rw-r--r--chrome/browser/extensions/api/webstore_private/webstore_private_api.h5
-rw-r--r--chrome/browser/extensions/webstore_installer.cc3
3 files changed, 8 insertions, 38 deletions
diff --git a/chrome/browser/extensions/api/webstore_private/webstore_private_api.cc b/chrome/browser/extensions/api/webstore_private/webstore_private_api.cc
index 6aa99a8..e12f330 100644
--- a/chrome/browser/extensions/api/webstore_private/webstore_private_api.cc
+++ b/chrome/browser/extensions/api/webstore_private/webstore_private_api.cc
@@ -176,16 +176,6 @@ base::DictionaryValue* CreateLoginResult(Profile* profile) {
WebstoreInstaller::Delegate* test_webstore_installer_delegate = NULL;
-void EnableAppLauncher(base::Callback<void(bool)> callback) {
-#if defined(OS_WIN)
- LOG(INFO) << "Enabling App Launcher via internal enable";
- AppListService::Get()->EnableAppList();
- callback.Run(true);
-#else
- callback.Run(true);
-#endif
-}
-
// We allow the web store to set a string containing login information when a
// purchase is made, so that when a user logs into sync with a different
// account we can recognize the situation. The Get function returns the login if
@@ -569,21 +559,9 @@ bool CompleteInstallFunction::RunImpl() {
// Balanced in OnExtensionInstallSuccess() or OnExtensionInstallFailure().
AddRef();
- if (approval_->enable_launcher) {
- EnableAppLauncher(
- base::Bind(&CompleteInstallFunction::AfterMaybeInstallAppLauncher,
- this));
- } else {
- AfterMaybeInstallAppLauncher(true);
- }
-
- return true;
-}
+ if (approval_->enable_launcher)
+ AppListService::Get()->EnableAppList();
-void CompleteInstallFunction::AfterMaybeInstallAppLauncher(bool ok) {
- if (!ok)
- LOG(ERROR) << "Error installing app launcher";
- std::string id = approval_->extension_id;
if (apps::IsAppLauncherEnabled()) {
// Show the app list to show download is progressing. Don't show the app
// list on first app install so users can be trained to open it themselves.
@@ -598,6 +576,8 @@ void CompleteInstallFunction::AfterMaybeInstallAppLauncher(bool ok) {
&(dispatcher()->delegate()->GetAssociatedWebContents()->GetController()),
id, approval_.Pass(), WebstoreInstaller::FLAG_NONE);
installer->Start();
+
+ return true;
}
void CompleteInstallFunction::OnExtensionInstallSuccess(
@@ -636,17 +616,11 @@ EnableAppLauncherFunction::EnableAppLauncherFunction() {}
EnableAppLauncherFunction::~EnableAppLauncherFunction() {}
bool EnableAppLauncherFunction::RunImpl() {
- EnableAppLauncher(
- base::Bind(&EnableAppLauncherFunction::AfterEnableAppLauncher, this));
+ AppListService::Get()->EnableAppList();
+ SendResponse(true);
return true;
}
-void EnableAppLauncherFunction::AfterEnableAppLauncher(bool ok) {
- if (!ok)
- LOG(ERROR) << "Error installing app launcher";
- SendResponse(ok);
-}
-
bool GetBrowserLoginFunction::RunImpl() {
SetResult(CreateLoginResult(profile_->GetOriginalProfile()));
return true;
diff --git a/chrome/browser/extensions/api/webstore_private/webstore_private_api.h b/chrome/browser/extensions/api/webstore_private/webstore_private_api.h
index 5866259..2337bc3 100644
--- a/chrome/browser/extensions/api/webstore_private/webstore_private_api.h
+++ b/chrome/browser/extensions/api/webstore_private/webstore_private_api.h
@@ -190,8 +190,6 @@ class CompleteInstallFunction
virtual bool RunImpl() OVERRIDE;
private:
- void AfterMaybeInstallAppLauncher(bool ok);
-
scoped_ptr<WebstoreInstaller::Approval> approval_;
};
@@ -208,9 +206,6 @@ class EnableAppLauncherFunction
// ExtensionFunction:
virtual bool RunImpl() OVERRIDE;
-
- private:
- void AfterEnableAppLauncher(bool ok);
};
class GetBrowserLoginFunction : public SyncExtensionFunction {
diff --git a/chrome/browser/extensions/webstore_installer.cc b/chrome/browser/extensions/webstore_installer.cc
index 6d16f26..47af623 100644
--- a/chrome/browser/extensions/webstore_installer.cc
+++ b/chrome/browser/extensions/webstore_installer.cc
@@ -161,7 +161,8 @@ WebstoreInstaller::Approval::Approval()
: profile(NULL),
use_app_installed_bubble(false),
skip_post_install_ui(false),
- skip_install_dialog(false) {
+ skip_install_dialog(false),
+ enable_launcher(false) {
}
scoped_ptr<WebstoreInstaller::Approval>