diff options
author | tapted <tapted@chromium.org> | 2015-01-08 17:25:53 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-01-09 01:26:34 +0000 |
commit | 9008769924ac7544e3fc2467a27c0acb40214cec (patch) | |
tree | d45d073e6e2beceacc401cc3972bf1426da42b25 | |
parent | 400a699a907936eefe1f73918833363db436c128 (diff) | |
download | chromium_src-9008769924ac7544e3fc2467a27c0acb40214cec.zip chromium_src-9008769924ac7544e3fc2467a27c0acb40214cec.tar.gz chromium_src-9008769924ac7544e3fc2467a27c0acb40214cec.tar.bz2 |
Purge AppListService::HandleFirstRun()
It's meant to recreate app list shortcuts if a first run is detected and
the user_data_dir's local_state has the app list enabled. But, in normal
use, a first_run is never detected when a user_data_dir is present, so
the code currently never gets run.
It could have worked once by using
chrome_launcher_support::IsAppLauncherPresent() which stored registry
values, but that code is all deleted now.
BUG=446446, 258746
Review URL: https://codereview.chromium.org/842543002
Cr-Commit-Position: refs/heads/master@{#310650}
7 files changed, 4 insertions, 32 deletions
diff --git a/chrome/browser/chrome_browser_main.cc b/chrome/browser/chrome_browser_main.cc index cab921c..842090b 100644 --- a/chrome/browser/chrome_browser_main.cc +++ b/chrome/browser/chrome_browser_main.cc @@ -976,8 +976,6 @@ int ChromeBrowserMainParts::PreCreateThreadsImpl() { prefs::kBrowserSuppressDefaultBrowserPrompt, master_prefs_->suppress_default_browser_prompt_for_version); } - - AppListService::Get(chrome::HOST_DESKTOP_TYPE_NATIVE)->HandleFirstRun(); } #endif diff --git a/chrome/browser/ui/app_list/app_list_service.h b/chrome/browser/ui/app_list/app_list_service.h index 278ecbb..d4ce736 100644 --- a/chrome/browser/ui/app_list/app_list_service.h +++ b/chrome/browser/ui/app_list/app_list_service.h @@ -40,7 +40,9 @@ class AppListService { ENABLE_FOR_APP_INSTALL, // Triggered by a webstore packaged app install. ENABLE_VIA_WEBSTORE_LINK, // Triggered by webstore explicitly via API. ENABLE_VIA_COMMAND_LINE, // Triggered by --enable-app-list. - ENABLE_ON_REINSTALL, // Triggered by Chrome reinstall finding pref. + ENABLE_ON_REINSTALL_UNUSED, // Triggered by Chrome reinstall finding pref. + // Unused since detecting a reinstall and + // detecting a pref are mutually exclusive. ENABLE_SHOWN_UNDISCOVERED, // This overrides a prior ENABLE_FOR_APP_INSTALL // when the launcher is auto-shown without // being "discovered" beforehand. @@ -65,10 +67,6 @@ class AppListService { // painted. virtual void SetAppListNextPaintCallback(void (*callback)()) = 0; - // Perform Chrome first run logic. This is executed before Chrome's threads - // have been created. - virtual void HandleFirstRun() = 0; - virtual base::FilePath GetProfilePath( const base::FilePath& user_data_dir) = 0; virtual void SetProfilePath(const base::FilePath& profile_path) = 0; diff --git a/chrome/browser/ui/app_list/app_list_service_disabled.cc b/chrome/browser/ui/app_list/app_list_service_disabled.cc index d04ba81..e415e8e 100644 --- a/chrome/browser/ui/app_list/app_list_service_disabled.cc +++ b/chrome/browser/ui/app_list/app_list_service_disabled.cc @@ -22,7 +22,6 @@ class AppListServiceDisabled : public AppListService { // AppListService overrides: void SetAppListNextPaintCallback(void (*callback)()) override {} - void HandleFirstRun() override {} void Init(Profile* initial_profile) override {} base::FilePath GetProfilePath(const base::FilePath& user_data_dir) override { diff --git a/chrome/browser/ui/app_list/app_list_service_impl.cc b/chrome/browser/ui/app_list/app_list_service_impl.cc index 5e83b95..8b5c914 100644 --- a/chrome/browser/ui/app_list/app_list_service_impl.cc +++ b/chrome/browser/ui/app_list/app_list_service_impl.cc @@ -258,8 +258,6 @@ AppListViewDelegate* AppListServiceImpl::GetViewDelegate(Profile* profile) { void AppListServiceImpl::SetAppListNextPaintCallback(void (*callback)()) {} -void AppListServiceImpl::HandleFirstRun() {} - void AppListServiceImpl::Init(Profile* initial_profile) {} base::FilePath AppListServiceImpl::GetProfilePath( diff --git a/chrome/browser/ui/app_list/app_list_service_impl.h b/chrome/browser/ui/app_list/app_list_service_impl.h index 6dd0dab..2e4a83d 100644 --- a/chrome/browser/ui/app_list/app_list_service_impl.h +++ b/chrome/browser/ui/app_list/app_list_service_impl.h @@ -48,7 +48,6 @@ class AppListServiceImpl : public AppListService, // AppListService overrides: void SetAppListNextPaintCallback(void (*callback)()) override; - void HandleFirstRun() override; void Init(Profile* initial_profile) override; base::FilePath GetProfilePath(const base::FilePath& user_data_dir) override; void SetProfilePath(const base::FilePath& profile_path) override; diff --git a/chrome/browser/ui/views/app_list/win/app_list_service_win.cc b/chrome/browser/ui/views/app_list/win/app_list_service_win.cc index 2a2c5b9..e40f277 100644 --- a/chrome/browser/ui/views/app_list/win/app_list_service_win.cc +++ b/chrome/browser/ui/views/app_list/win/app_list_service_win.cc @@ -262,8 +262,7 @@ AppListServiceWin* AppListServiceWin::GetInstance() { AppListServiceWin::AppListServiceWin() : AppListServiceViews(scoped_ptr<AppListControllerDelegate>( - new AppListControllerDelegateWin(this))), - enable_app_list_on_next_init_(false) { + new AppListControllerDelegateWin(this))) { } AppListServiceWin::~AppListServiceWin() { @@ -295,24 +294,7 @@ void AppListServiceWin::SetAppListNextPaintCallback(void (*callback)()) { next_paint_callback_ = base::Bind(callback); } -void AppListServiceWin::HandleFirstRun() { - PrefService* local_state = g_browser_process->local_state(); - // If the app list is already enabled during first run, then the user had - // opted in to the app launcher before uninstalling, so we re-enable to - // restore shortcuts to the app list. - // Note we can't directly create the shortcuts here because the IO thread - // hasn't been created yet. - enable_app_list_on_next_init_ = local_state->GetBoolean( - prefs::kAppLauncherHasBeenEnabled); -} - void AppListServiceWin::Init(Profile* initial_profile) { - if (enable_app_list_on_next_init_) { - enable_app_list_on_next_init_ = false; - EnableAppList(initial_profile, ENABLE_ON_REINSTALL); - CreateShortcut(); - } - ScheduleWarmup(); MigrateAppLauncherEnabledPref(); diff --git a/chrome/browser/ui/views/app_list/win/app_list_service_win.h b/chrome/browser/ui/views/app_list/win/app_list_service_win.h index 2b95356..6168b31 100644 --- a/chrome/browser/ui/views/app_list/win/app_list_service_win.h +++ b/chrome/browser/ui/views/app_list/win/app_list_service_win.h @@ -21,7 +21,6 @@ class AppListServiceWin : public AppListServiceViews { // AppListService overrides: virtual void SetAppListNextPaintCallback(void (*callback)()) override; - virtual void HandleFirstRun() override; virtual void Init(Profile* initial_profile) override; virtual void ShowForProfile(Profile* requested_profile) override; virtual void CreateShortcut() override; @@ -49,7 +48,6 @@ class AppListServiceWin : public AppListServiceViews { void LoadProfileForWarmup(); void OnLoadProfileForWarmup(Profile* initial_profile); - bool enable_app_list_on_next_init_; scoped_ptr<ActivationTrackerWin> activation_tracker_; base::Closure next_paint_callback_; |