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.
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_
8 #include "base/memory/singleton.h"
9 #include "chrome/browser/ui/app_list/app_list_service_impl.h"
17 // Exposes methods required by the AppListServiceTestApi on Windows.
18 // TODO(tapted): Remove testing methods once they can access the implementation
20 class AppListServiceWin : public AppListServiceImpl {
23 virtual ~AppListServiceWin();
25 app_list::AppListModel* GetAppListModelForTesting();
27 static AppListServiceWin* GetInstance();
28 void set_can_close(bool can_close);
29 void OnAppListClosing();
31 // AppListService overrides:
32 virtual void SetAppListNextPaintCallback(
33 const base::Closure& callback) OVERRIDE;
34 virtual void HandleFirstRun() OVERRIDE;
35 virtual void Init(Profile* initial_profile) OVERRIDE;
36 virtual void CreateForProfile(Profile* requested_profile) OVERRIDE;
37 virtual void ShowForProfile(Profile* requested_profile) OVERRIDE;
38 virtual void DismissAppList() OVERRIDE;
39 virtual bool IsAppListVisible() const OVERRIDE;
40 virtual gfx::NativeWindow GetAppListWindow() OVERRIDE;
41 virtual Profile* GetCurrentAppListProfile() OVERRIDE;
42 virtual AppListControllerDelegate* CreateControllerDelegate() OVERRIDE;
44 // AppListServiceImpl overrides:
45 virtual void CreateShortcut() OVERRIDE;
48 friend struct DefaultSingletonTraits<AppListServiceWin>;
50 bool IsWarmupNeeded();
51 void ScheduleWarmup();
53 // Loads the profile last used with the app list and populates the view from
54 // it without showing it so that the next show is faster. Does nothing if the
55 // view already exists, or another profile is in the middle of being loaded to
57 void LoadProfileForWarmup();
58 void OnLoadProfileForWarmup(Profile* initial_profile);
60 // Responsible for putting views on the screen.
61 scoped_ptr<AppListShower> shower_;
63 bool enable_app_list_on_next_init_;
65 base::WeakPtrFactory<AppListServiceWin> weak_factory_;
67 DISALLOW_COPY_AND_ASSIGN(AppListServiceWin);
72 AppListService* GetAppListServiceWin();
76 #endif // CHROME_BROWSER_UI_VIEWS_APP_LIST_WIN_APP_LIST_SERVICE_WIN_H_