OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/ui/app_list/app_list_service_impl.h" | 5 #include "chrome/browser/ui/app_list/app_list_service_impl.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "apps/pref_names.h" | 9 #include "apps/pref_names.h" |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 332 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
343 FROM_HERE, | 343 FROM_HERE, |
344 base::Bind(&RecordAppListDiscoverability, | 344 base::Bind(&RecordAppListDiscoverability, |
345 base::Unretained(local_state_), | 345 base::Unretained(local_state_), |
346 false), | 346 false), |
347 base::TimeDelta::FromMinutes(kDiscoverabilityTimeoutMinutes)); | 347 base::TimeDelta::FromMinutes(kDiscoverabilityTimeoutMinutes)); |
348 } | 348 } |
349 | 349 |
350 AppShortcutManager* shortcut_manager = | 350 AppShortcutManager* shortcut_manager = |
351 AppShortcutManagerFactory::GetForProfile(initial_profile); | 351 AppShortcutManagerFactory::GetForProfile(initial_profile); |
352 if (shortcut_manager) | 352 if (shortcut_manager) |
353 shortcut_manager->OnceOffCreateShortcuts(); | 353 shortcut_manager->UpdateShortcutsForAllAppsIfNeeded(); |
354 } | 354 } |
355 | 355 |
356 void AppListServiceImpl::InvalidatePendingProfileLoads() { | 356 void AppListServiceImpl::InvalidatePendingProfileLoads() { |
357 profile_loader_->InvalidatePendingProfileLoads(); | 357 profile_loader_->InvalidatePendingProfileLoads(); |
358 } | 358 } |
359 | 359 |
360 void AppListServiceImpl::PerformStartupChecks(Profile* initial_profile) { | 360 void AppListServiceImpl::PerformStartupChecks(Profile* initial_profile) { |
361 // Except in rare, once-off cases, this just checks that a pref is "0" and | 361 // Except in rare, once-off cases, this just checks that a pref is "0" and |
362 // returns. | 362 // returns. |
363 RecordAppListDiscoverability(local_state_, true); | 363 RecordAppListDiscoverability(local_state_, true); |
364 | 364 |
365 if (command_line_.HasSwitch(switches::kResetAppListInstallState)) | 365 if (command_line_.HasSwitch(switches::kResetAppListInstallState)) |
366 local_state_->SetBoolean(prefs::kAppLauncherHasBeenEnabled, false); | 366 local_state_->SetBoolean(prefs::kAppLauncherHasBeenEnabled, false); |
367 | 367 |
368 if (command_line_.HasSwitch(switches::kEnableAppList)) | 368 if (command_line_.HasSwitch(switches::kEnableAppList)) |
369 EnableAppList(initial_profile, ENABLE_VIA_COMMAND_LINE); | 369 EnableAppList(initial_profile, ENABLE_VIA_COMMAND_LINE); |
370 | 370 |
371 if (!base::MessageLoop::current()) | 371 if (!base::MessageLoop::current()) |
372 return; // In a unit test. | 372 return; // In a unit test. |
373 | 373 |
374 // Send app list usage stats after a delay. | 374 // Send app list usage stats after a delay. |
375 const int kSendUsageStatsDelay = 5; | 375 const int kSendUsageStatsDelay = 5; |
376 base::MessageLoop::current()->PostDelayedTask( | 376 base::MessageLoop::current()->PostDelayedTask( |
377 FROM_HERE, | 377 FROM_HERE, |
378 base::Bind(&AppListServiceImpl::SendAppListStats), | 378 base::Bind(&AppListServiceImpl::SendAppListStats), |
379 base::TimeDelta::FromSeconds(kSendUsageStatsDelay)); | 379 base::TimeDelta::FromSeconds(kSendUsageStatsDelay)); |
380 } | 380 } |
OLD | NEW |