app_list_service_win.h revision 010d83a9304c5a91596085d917d248abff47903a
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_views.h"
10
11class ActivationTrackerWin;
12
13template <typename T> struct DefaultSingletonTraits;
14
15class AppListServiceWin : public AppListServiceViews {
16 public:
17  virtual ~AppListServiceWin();
18
19  static AppListServiceWin* GetInstance();
20
21  // AppListService overrides:
22  virtual void SetAppListNextPaintCallback(void (*callback)()) OVERRIDE;
23  virtual void HandleFirstRun() OVERRIDE;
24  virtual void Init(Profile* initial_profile) OVERRIDE;
25  virtual void ShowForProfile(Profile* requested_profile) OVERRIDE;
26
27  // AppListServiceImpl overrides:
28  virtual void CreateShortcut() OVERRIDE;
29
30 private:
31  friend struct DefaultSingletonTraits<AppListServiceWin>;
32
33  // AppListServiceViews overrides:
34  virtual void OnViewBeingDestroyed();
35
36  // AppListShowerDelegate overrides:
37  virtual void OnViewCreated() OVERRIDE;
38  virtual void OnViewDismissed() OVERRIDE;
39  virtual void MoveNearCursor(app_list::AppListView* view) OVERRIDE;
40
41  AppListServiceWin();
42
43  bool IsWarmupNeeded();
44  void ScheduleWarmup();
45
46  // Loads the profile last used with the app list and populates the view from
47  // it without showing it so that the next show is faster. Does nothing if the
48  // view already exists, or another profile is in the middle of being loaded to
49  // be shown.
50  void LoadProfileForWarmup();
51  void OnLoadProfileForWarmup(Profile* initial_profile);
52
53  bool enable_app_list_on_next_init_;
54  scoped_ptr<ActivationTrackerWin> activation_tracker_;
55
56  DISALLOW_COPY_AND_ASSIGN(AppListServiceWin);
57};
58
59#endif  // CHROME_BROWSER_UI_VIEWS_APP_LIST_WIN_APP_LIST_SERVICE_WIN_H_
60