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_APP_LIST_APP_LIST_SERVICE_H_
6 #define CHROME_BROWSER_UI_APP_LIST_APP_LIST_SERVICE_H_
10 #include "base/basictypes.h"
11 #include "base/callback_forward.h"
12 #include "base/compiler_specific.h"
13 #include "chrome/browser/ui/host_desktop.h"
14 #include "ui/gfx/native_widget_types.h"
16 class AppListControllerDelegate;
18 class PrefRegistrySimple;
29 class AppListService {
31 // Get the AppListService for the current platform and specified
33 static AppListService* Get(chrome::HostDesktopType desktop_type);
35 // Call Init for all AppListService instances on this platform.
36 static void InitAll(Profile* initial_profile);
38 static void RegisterPrefs(PrefRegistrySimple* registry);
40 static void RecordShowTimings(const CommandLine& command_line);
42 // Indicates that |callback| should be called next time the app list is
44 virtual void SetAppListNextPaintCallback(const base::Closure& callback) = 0;
46 // Perform Chrome first run logic. This is executed before Chrome's threads
48 virtual void HandleFirstRun() = 0;
50 virtual base::FilePath GetProfilePath(
51 const base::FilePath& user_data_dir) = 0;
52 virtual void SetProfilePath(const base::FilePath& profile_path) = 0;
54 // Show the app list for the profile configured in the user data dir for the
55 // current browser process.
56 virtual void Show() = 0;
58 // Create the app list UI, and maintain its state, but do not show it.
59 virtual void CreateForProfile(Profile* requested_profile) = 0;
61 // Show the app list for the given profile. If it differs from the profile the
62 // app list is currently showing, repopulate the app list and save the new
63 // profile to local prefs as the default app list profile.
64 virtual void ShowForProfile(Profile* requested_profile) = 0;
66 // Dismiss the app list.
67 virtual void DismissAppList() = 0;
69 // Get the profile the app list is currently showing.
70 virtual Profile* GetCurrentAppListProfile() = 0;
72 // Returns true if the app list is visible.
73 virtual bool IsAppListVisible() const = 0;
75 // Enable the app list. What this does specifically will depend on the host
76 // operating system and shell.
77 virtual void EnableAppList(Profile* initial_profile) = 0;
79 // Get the window the app list is in, or NULL if the app list isn't visible.
80 virtual gfx::NativeWindow GetAppListWindow() = 0;
82 // Creates a platform specific AppListControllerDelegate.
83 virtual AppListControllerDelegate* CreateControllerDelegate() = 0;
87 virtual ~AppListService() {}
89 // Do any once off initialization needed for the app list.
90 virtual void Init(Profile* initial_profile) = 0;
93 DISALLOW_COPY_AND_ASSIGN(AppListService);
96 #endif // CHROME_BROWSER_UI_APP_LIST_APP_LIST_SERVICE_H_