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 #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 // Called on the UI thread after determining if the launcher is enabled. A |
13 // boolean flag is passed, which is true if the app launcher is enabled. | 13 // boolean flag is passed, which is true if the app launcher is enabled. |
14 typedef base::Callback<void(bool)> OnAppLauncherEnabledCompleted; | 14 typedef base::Callback<void(bool)> OnAppLauncherEnabledCompleted; |
15 | 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. |
| 19 |
16 // A synchronous check to determine if the app launcher is enabled. If the | 20 // A synchronous check to determine if the app launcher is enabled. If the |
17 // registry needs to be determined to find an accurate answer, this function | 21 // registry needs to be determined to find an accurate answer, this function |
18 // will NOT do so; instead if will default to false (the app launcher is not | 22 // will NOT do so; instead if will default to false (the app launcher is not |
19 // enabled). | 23 // enabled). |
20 // This function does not use the cached preference of whether the launcher | 24 // This function does not use the cached preference of whether the launcher |
21 // was enabled or not. | 25 // was enabled or not. |
22 bool MaybeIsAppLauncherEnabled(); | 26 bool MaybeIsAppLauncherEnabled(); |
23 | 27 |
24 // Determine whether the app launcher is enabled or not. This may involve a trip | 28 // Determine whether the app launcher is enabled or not. This may involve a trip |
25 // to a blocking thread. |completion_callback| is called when an answer is | 29 // to a blocking thread. |completion_callback| is called when an answer is |
26 // ready. This needs to be called on the UI thread. | 30 // ready. This needs to be called on the UI thread. |
27 void GetIsAppLauncherEnabled( | 31 void GetIsAppLauncherEnabled( |
28 const OnAppLauncherEnabledCompleted& completion_callback); | 32 const OnAppLauncherEnabledCompleted& completion_callback); |
29 | 33 |
30 // Returns whether the app launcher was enabled the last time it was checked. | 34 // Returns whether the app launcher was enabled the last time it was checked. |
31 bool WasAppLauncherEnabled(); | 35 bool WasAppLauncherEnabled(); |
32 | 36 |
33 } // namespace apps | 37 } // namespace apps |
34 | 38 |
35 #endif // APPS_APP_LAUNCHER_H_ | 39 #endif // APPS_APP_LAUNCHER_H_ |
OLD | NEW |