Index: chrome/browser/ui/app_list/app_list_service_selector.cc |
diff --git a/chrome/browser/ui/app_list/app_list_service_selector.cc b/chrome/browser/ui/app_list/app_list_service_selector.cc |
new file mode 100644 |
index 0000000000000000000000000000000000000000..84fd5202fdb095b965d2920d29654c1646a988d2 |
--- /dev/null |
+++ b/chrome/browser/ui/app_list/app_list_service_selector.cc |
@@ -0,0 +1,36 @@ |
+// Copyright 2013 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#include "chrome/browser/ui/app_list/app_list_service.h" |
+#include "chrome/browser/ui/host_desktop.h" |
+ |
+#if defined(USE_ASH) |
+#include "chrome/browser/ui/app_list/app_list_service_ash.h" |
+#endif |
+ |
+#if defined(OS_WIN) |
+#include "chrome/browser/ui/app_list/app_list_service_win.h" |
+#endif |
+ |
+#if defined(OS_MACOSX) |
+#include "chrome/browser/ui/app_list/app_list_service_cocoa.h" |
+#endif |
+ |
+// static |
+AppListService* AppListService::Get() { |
+#if defined(USE_ASH) && defined(OS_WIN) |
+ if (chrome::GetActiveDesktop() == chrome::HOST_DESKTOP_TYPE_ASH) |
+ return AppListServiceAsh::GetInstance(); |
+#endif |
+ |
+#if defined(OS_WIN) |
+ return AppListServiceWin::GetInstance(); |
+#elif defined(OS_MACOSX) |
+ return AppListServiceCocoa::GetInstance(); |
+#elif defined(OS_CHROMEOS) |
+ return AppListServiceAsh::GetInstance(); |
+#else |
+#error "ENABLE_APP_LIST defined, but no controller available" |
+#endif |
+} |