app_list_service_win.h revision 0529e5d033099cbfc42635f6f6183833b09dff6e
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_VIEWS_APP_LIST_WIN_APP_LIST_SERVICE_WIN_H_ 6#define CHROME_BROWSER_UI_VIEWS_APP_LIST_WIN_APP_LIST_SERVICE_WIN_H_ 7 8#include "base/memory/scoped_ptr.h" 9#include "chrome/browser/ui/app_list/app_list_service_impl.h" 10 11namespace app_list{ 12class AppListModel; 13} 14 15class AppListControllerDelegateWin; 16class AppListShower; 17template <typename T> struct DefaultSingletonTraits; 18 19class AppListServiceWin : public AppListServiceImpl { 20 public: 21 AppListServiceWin(); 22 virtual ~AppListServiceWin(); 23 24 static AppListServiceWin* GetInstance(); 25 void set_can_close(bool can_close); 26 void OnViewBeingDestroyed(); 27 28 // AppListService overrides: 29 virtual void SetAppListNextPaintCallback(void (*callback)()) OVERRIDE; 30 virtual void HandleFirstRun() OVERRIDE; 31 virtual void Init(Profile* initial_profile) OVERRIDE; 32 virtual void CreateForProfile(Profile* requested_profile) OVERRIDE; 33 virtual void ShowForProfile(Profile* requested_profile) OVERRIDE; 34 virtual void DismissAppList() OVERRIDE; 35 virtual bool IsAppListVisible() const OVERRIDE; 36 virtual gfx::NativeWindow GetAppListWindow() OVERRIDE; 37 virtual Profile* GetCurrentAppListProfile() OVERRIDE; 38 virtual AppListControllerDelegate* GetControllerDelegate() OVERRIDE; 39 40 // AppListServiceImpl overrides: 41 virtual void CreateShortcut() OVERRIDE; 42 43 private: 44 friend struct DefaultSingletonTraits<AppListServiceWin>; 45 46 bool IsWarmupNeeded(); 47 void ScheduleWarmup(); 48 49 // Loads the profile last used with the app list and populates the view from 50 // it without showing it so that the next show is faster. Does nothing if the 51 // view already exists, or another profile is in the middle of being loaded to 52 // be shown. 53 void LoadProfileForWarmup(); 54 void OnLoadProfileForWarmup(Profile* initial_profile); 55 56 bool enable_app_list_on_next_init_; 57 58 // Responsible for putting views on the screen. 59 scoped_ptr<AppListShower> shower_; 60 61 scoped_ptr<AppListControllerDelegateWin> controller_delegate_; 62 63 DISALLOW_COPY_AND_ASSIGN(AppListServiceWin); 64}; 65 66#endif // CHROME_BROWSER_UI_VIEWS_APP_LIST_WIN_APP_LIST_SERVICE_WIN_H_ 67