app_list_service.h revision 2a99a7e74a7f215066514fe81d2bfa6639d9eddd
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#ifndef CHROME_BROWSER_UI_APP_LIST_APP_LIST_SERVICE_H_ 6#define CHROME_BROWSER_UI_APP_LIST_APP_LIST_SERVICE_H_ 7 8#include <string> 9 10#include "base/basictypes.h" 11#include "base/compiler_specific.h" 12#include "chrome/browser/profiles/profile_info_cache_observer.h" 13 14class AppListControllerDelegate; 15class PrefRegistrySimple; 16class Profile; 17 18namespace base { 19class FilePath; 20} 21 22namespace gfx { 23class ImageSkia; 24} 25 26class AppListService : public ProfileInfoCacheObserver { 27 public: 28 // Get the AppListService for the current platform and desktop type. 29 static AppListService* Get(); 30 31 // Call Init for all AppListService instances on this platform. 32 static void InitAll(Profile* initial_profile); 33 34 static void RegisterPrefs(PrefRegistrySimple* registry); 35 36 virtual base::FilePath GetAppListProfilePath( 37 const base::FilePath& user_data_dir); 38 39 // Show the app list. 40 virtual void ShowAppList(Profile* profile); 41 42 // Dismiss the app list. 43 virtual void DismissAppList(); 44 45 virtual void SetAppListProfile(const base::FilePath& profile_file_path); 46 47 // Get the profile the app list is currently showing. 48 virtual Profile* GetCurrentAppListProfile(); 49 50 // Returns true if the app list is visible. 51 virtual bool IsAppListVisible() const; 52 53 // ProfileInfoCacheObserver overrides: 54 virtual void OnProfileAdded(const base::FilePath& profilePath) OVERRIDE; 55 virtual void OnProfileWillBeRemoved( 56 const base::FilePath& profile_path) OVERRIDE; 57 virtual void OnProfileWasRemoved(const base::FilePath& profile_path, 58 const string16& profile_name) OVERRIDE; 59 virtual void OnProfileNameChanged(const base::FilePath& profile_path, 60 const string16& profile_name) OVERRIDE; 61 virtual void OnProfileAvatarChanged( 62 const base::FilePath& profile_path) OVERRIDE; 63 64 // Exposed to allow testing of the controller delegate. 65 virtual AppListControllerDelegate* CreateControllerDelegate(); 66 protected: 67 AppListService() {} 68 virtual ~AppListService() {} 69 70 // Do any once off initialization needed for the app list. 71 virtual void Init(Profile* initial_profile); 72 73 private: 74 DISALLOW_COPY_AND_ASSIGN(AppListService); 75}; 76 77#endif // CHROME_BROWSER_UI_APP_LIST_APP_LIST_SERVICE_H_ 78