Home | History | Annotate | Download | only in app_list
      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
      3 // found in the LICENSE file.
      4 
      5 #include "chrome/browser/ui/app_list/app_list_service_win.h"
      6 
      7 #include "chrome/browser/ui/app_list/app_list_service.h"
      8 #include "grit/theme_resources.h"
      9 
     10 #if defined(USE_ASH)
     11 #include "chrome/browser/ui/app_list/app_list_service_ash.h"
     12 #include "chrome/browser/ui/host_desktop.h"
     13 #endif
     14 
     15 #if defined(GOOGLE_CHROME_BUILD)
     16 #include "chrome/installer/util/install_util.h"
     17 #endif
     18 
     19 namespace chrome {
     20 
     21 int GetAppListIconResourceId() {
     22   int icon_id = IDR_APP_LIST;
     23 #if defined(GOOGLE_CHROME_BUILD)
     24   if (InstallUtil::IsChromeSxSProcess())
     25     icon_id = IDR_APP_LIST_SXS;
     26 #endif
     27   return icon_id;
     28 }
     29 
     30 }  // namespace chrome
     31 
     32 // static
     33 AppListService* AppListService::Get() {
     34 #if defined(USE_ASH)
     35   if (chrome::GetActiveDesktop() == chrome::HOST_DESKTOP_TYPE_ASH)
     36     return chrome::GetAppListServiceAsh();
     37 #endif
     38 
     39   return chrome::GetAppListServiceWin();
     40 }
     41 
     42 // static
     43 void AppListService::InitAll(Profile* initial_profile) {
     44 #if defined(USE_ASH)
     45   chrome::GetAppListServiceAsh()->Init(initial_profile);
     46 #endif
     47   chrome::GetAppListServiceWin()->Init(initial_profile);
     48 }
     49