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 "base/files/file_path.h"
      6 #include "base/memory/singleton.h"
      7 #include "chrome/browser/ui/app_list/app_list_service.h"
      8 
      9 namespace {
     10 
     11 class AppListServiceDisabled : public AppListService {
     12  public:
     13   static AppListServiceDisabled* GetInstance() {
     14     return Singleton<AppListServiceDisabled,
     15                      LeakySingletonTraits<AppListServiceDisabled> >::get();
     16   }
     17 
     18  private:
     19   friend struct DefaultSingletonTraits<AppListServiceDisabled>;
     20 
     21   AppListServiceDisabled() {}
     22 
     23   // AppListService overrides:
     24   virtual void SetAppListNextPaintCallback(void (*callback)()) OVERRIDE {}
     25   virtual void HandleFirstRun() OVERRIDE {}
     26   virtual void Init(Profile* initial_profile) OVERRIDE {}
     27 
     28   virtual base::FilePath GetProfilePath(
     29       const base::FilePath& user_data_dir) OVERRIDE {
     30     return base::FilePath();
     31   }
     32   virtual void SetProfilePath(const base::FilePath& profile_path) OVERRIDE {}
     33 
     34   virtual void Show() OVERRIDE {}
     35   virtual void CreateForProfile(Profile* profile) OVERRIDE {}
     36   virtual void ShowForProfile(Profile* profile) OVERRIDE {}
     37   virtual void AutoShowForProfile(Profile* profile) OVERRIDE {}
     38   virtual void DismissAppList() OVERRIDE {}
     39 
     40   virtual Profile* GetCurrentAppListProfile() OVERRIDE { return NULL; }
     41   virtual bool IsAppListVisible() const OVERRIDE { return false; }
     42   virtual void EnableAppList(Profile* initial_profile,
     43                              AppListEnableSource enable_source) OVERRIDE {}
     44   virtual AppListControllerDelegate* GetControllerDelegate() OVERRIDE {
     45     return NULL;
     46   }
     47 
     48   virtual void CreateShortcut() OVERRIDE {}
     49 
     50   virtual gfx::NativeWindow GetAppListWindow() OVERRIDE {
     51     return NULL;
     52   }
     53 
     54   DISALLOW_COPY_AND_ASSIGN(AppListServiceDisabled);
     55 };
     56 
     57 }  // namespace
     58 
     59 // static
     60 AppListService* AppListService::Get(chrome::HostDesktopType desktop_type) {
     61   return AppListServiceDisabled::GetInstance();
     62 }
     63 
     64 // static
     65 void AppListService::InitAll(Profile* initial_profile) {}
     66 
     67 // static
     68 void AppListService::RegisterPrefs(PrefRegistrySimple* registry) {}
     69 
     70 // static
     71 bool AppListService::HandleLaunchCommandLine(
     72     const base::CommandLine& command_line,
     73     Profile* launch_profile) {
     74   return false;
     75 }
     76