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