app_list_service.h revision 90dce4d38c5ff5333bea97d859d4e484e27edf0c
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
13class AppListControllerDelegate;
14class CommandLine;
15class PrefRegistrySimple;
16class Profile;
17
18namespace base {
19class FilePath;
20}
21
22namespace gfx {
23class ImageSkia;
24}
25
26class AppListService {
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 GetProfilePath(
37      const base::FilePath& user_data_dir) = 0;
38
39  static void RecordShowTimings(const CommandLine& command_line);
40
41  // Show the app list.
42  virtual void ShowAppList(Profile* requested_profile) = 0;
43
44  // Dismiss the app list.
45  virtual void DismissAppList() = 0;
46
47  // TODO(koz): Merge this into ShowAppList().
48  virtual void SetAppListProfile(const base::FilePath& profile_file_path) = 0;
49
50  // Show the app list for the profile configured in the user data dir for the
51  // current browser process.
52  virtual void ShowForSavedProfile() = 0;
53
54  // Get the profile the app list is currently showing.
55  virtual Profile* GetCurrentAppListProfile() = 0;
56
57  // Returns true if the app list is visible.
58  virtual bool IsAppListVisible() const = 0;
59
60  // Enable the app list. What this does specifically will depend on the host
61  // operating system and shell.
62  virtual void EnableAppList() = 0;
63
64  // Exposed to allow testing of the controller delegate.
65  virtual AppListControllerDelegate* CreateControllerDelegate() = 0;
66
67 protected:
68  AppListService() {}
69  virtual ~AppListService() {}
70
71  // Do any once off initialization needed for the app list.
72  virtual void Init(Profile* initial_profile) = 0;
73
74 private:
75  DISALLOW_COPY_AND_ASSIGN(AppListService);
76};
77
78#endif  // CHROME_BROWSER_UI_APP_LIST_APP_LIST_SERVICE_H_
79