Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(18)

Side by Side Diff: chrome/browser/ui/app_list/app_list_service_impl.cc

Issue 263403002: Replace OnceOffCreateShortcuts with UpdateShortcutsForAllAppsIfNeeded. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698