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

Side by Side Diff: apps/app_launcher.h

Issue 16172005: Clean up async app launcher enabled checks. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix test Created 7 years, 6 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
« no previous file with comments | « no previous file | apps/app_launcher.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 #ifndef APPS_APP_LAUNCHER_H_ 5 #ifndef APPS_APP_LAUNCHER_H_
6 #define APPS_APP_LAUNCHER_H_ 6 #define APPS_APP_LAUNCHER_H_
7 7
8 #include "base/callback_forward.h" 8 #include "base/callback_forward.h"
9 9
10 namespace apps { 10 namespace apps {
11 11
12 // Called on the UI thread after determining if the launcher is enabled. A 12 // Returns whether the app launcher has been enabled.
13 // boolean flag is passed, which is true if the app launcher is enabled. 13 bool IsAppLauncherEnabled();
14 typedef base::Callback<void(bool)> OnAppLauncherEnabledCompleted;
15
16 // TODO(calamity): Remove all the "uncertain" apis because windows app launcher
17 // enabled is now just a single pref that we can check synchronously and with
18 // confidence. This includes changing GetIsAppLauncherEnabled to a synchronous
19 // API.
20
21 // A synchronous check to determine if the app launcher is enabled. If the
22 // registry needs to be determined to find an accurate answer, this function
23 // will NOT do so; instead if will default to false (the app launcher is not
24 // enabled).
25 // This function does not use the cached preference of whether the launcher
26 // was enabled or not.
27 bool MaybeIsAppLauncherEnabled();
28
29 // Determine whether the app launcher is enabled or not. This may involve a trip
30 // to a blocking thread. |completion_callback| is called when an answer is
31 // ready. This needs to be called on the UI thread.
32 void GetIsAppLauncherEnabled(
33 const OnAppLauncherEnabledCompleted& completion_callback);
34
35 // Returns whether the app launcher was enabled the last time it was checked.
36 bool WasAppLauncherEnabled();
37 14
38 } // namespace apps 15 } // namespace apps
39 16
40 #endif // APPS_APP_LAUNCHER_H_ 17 #endif // APPS_APP_LAUNCHER_H_
OLDNEW
« no previous file with comments | « no previous file | apps/app_launcher.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698