Chromium Code Reviews| 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..ac6b37d3b1464ae60bc2ec43a85f38fe642d2629 |
| --- /dev/null |
| +++ b/chrome/browser/ui/app_list/app_list_service_selector.cc |
| @@ -0,0 +1,50 @@ |
| +// 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_mac.h" |
| +#endif |
| + |
| +#if !defined(ENABLE_APP_LIST) |
| +#include "chrome/browser/ui/app_list/app_list_service_disabled.h" |
| +#endif |
| + |
| +// static |
| +AppListService* AppListService::Get() { |
|
benwells
2013/02/26 01:18:25
As discussed disabled should be returned if !defin
tapted
2013/02/26 03:04:34
Done. There was a nested-#ifdef version in patch s
|
| +#if defined(USE_ASH) && defined(OS_WIN) |
| + if (chrome::GetActiveDesktop() == chrome::HOST_DESKTOP_TYPE_ASH) |
| + return chrome::GetAppListServiceAsh(); |
| +#endif |
| + |
| +#if defined(OS_WIN) |
| + return chrome::GetAppListServiceWin(); |
| +#elif defined(OS_MACOSX) |
| + return chrome::GetAppListServiceMac(); |
| +#elif defined(OS_CHROMEOS) |
| + return chrome::GetAppListServiceAsh(); |
| +#else |
| + return chrome::GetAppListServiceDisabled(); |
| +#endif |
| +} |
| + |
| +// static |
| +void AppListService::InitAll(Profile* initial_profile) { |
| +#if defined(USE_ASH) && defined(OS_WIN) |
| + chrome::GetAppListServiceAsh()->Init(initial_profile); |
| + chrome::GetAppListServiceWin()->Init(initial_profile); |
| +#else |
| + Get()->Init(initial_profile); |
| +#endif |
| +} |