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

Unified Diff: apps/app_launcher.cc

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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « apps/app_launcher.h ('k') | chrome/browser/extensions/api/webstore_private/webstore_private_api.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: apps/app_launcher.cc
diff --git a/apps/app_launcher.cc b/apps/app_launcher.cc
index 77a75fc858e85be68a55ac581d3e457f2ce636b2..0493c65aa4d8d30c530520fcd3531c31caf35b19 100644
--- a/apps/app_launcher.cc
+++ b/apps/app_launcher.cc
@@ -5,13 +5,10 @@
#include "apps/app_launcher.h"
#include "apps/pref_names.h"
-#include "base/command_line.h"
#include "base/prefs/pref_registry_simple.h"
#include "base/prefs/pref_service.h"
-#include "base/threading/sequenced_worker_pool.h"
#include "chrome/browser/browser_process.h"
#include "chrome/browser/ui/host_desktop.h"
-#include "content/public/browser/browser_thread.h"
#if defined(OS_WIN)
#include "chrome/installer/launcher_support/chrome_launcher_support.h"
@@ -20,54 +17,22 @@
namespace apps {
-namespace {
-
-enum AppLauncherState {
- APP_LAUNCHER_UNKNOWN,
- APP_LAUNCHER_ENABLED,
- APP_LAUNCHER_DISABLED,
-};
-
-AppLauncherState SynchronousAppLauncherChecks() {
+bool IsAppLauncherEnabled() {
#if defined(USE_ASH) && !defined(OS_WIN)
- return APP_LAUNCHER_ENABLED;
+ return true;
#elif !defined(OS_WIN)
- return APP_LAUNCHER_DISABLED;
+ return false;
#else
#if defined(USE_ASH)
if (chrome::GetActiveDesktop() == chrome::HOST_DESKTOP_TYPE_ASH)
- return APP_LAUNCHER_ENABLED;
+ return true;
#endif
PrefService* prefs = g_browser_process->local_state();
// In some tests, the prefs aren't initialised.
if (!prefs)
- return APP_LAUNCHER_UNKNOWN;
- return prefs->GetBoolean(prefs::kAppLauncherHasBeenEnabled) ?
- APP_LAUNCHER_ENABLED : APP_LAUNCHER_DISABLED;
+ return false;
+ return prefs->GetBoolean(prefs::kAppLauncherHasBeenEnabled);
#endif
}
-} // namespace
-
-bool MaybeIsAppLauncherEnabled() {
- return SynchronousAppLauncherChecks() == APP_LAUNCHER_ENABLED;
-}
-
-void GetIsAppLauncherEnabled(
- const OnAppLauncherEnabledCompleted& completion_callback) {
- DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI));
-
- AppLauncherState state = SynchronousAppLauncherChecks();
-
- if (state != APP_LAUNCHER_UNKNOWN) {
- completion_callback.Run(state == APP_LAUNCHER_ENABLED);
- return;
- }
- NOTREACHED();
-}
-
-bool WasAppLauncherEnabled() {
- return SynchronousAppLauncherChecks() == APP_LAUNCHER_ENABLED;
-}
-
} // namespace apps
« no previous file with comments | « apps/app_launcher.h ('k') | chrome/browser/extensions/api/webstore_private/webstore_private_api.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698