Disable view source for Developer Tools.
[chromium-blink-merge.git] / chrome / browser / ui / app_list / app_list_service.h
blob7205ad8f4aa5b7b01cfca6a49cf435281b530650
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_
8 #include <string>
10 #include "base/basictypes.h"
11 #include "base/compiler_specific.h"
12 #include "chrome/browser/ui/host_desktop.h"
13 #include "ui/gfx/native_widget_types.h"
15 class AppListControllerDelegate;
16 class CommandLine;
17 class PrefRegistrySimple;
18 class Profile;
20 namespace base {
21 class FilePath;
24 namespace gfx {
25 class ImageSkia;
28 class AppListService {
29 public:
30 // Get the AppListService for the current platform and specified
31 // |desktop_type|.
32 static AppListService* Get(chrome::HostDesktopType desktop_type);
34 // Call Init for all AppListService instances on this platform.
35 static void InitAll(Profile* initial_profile);
37 static void RegisterPrefs(PrefRegistrySimple* registry);
39 static void RecordShowTimings(const CommandLine& command_line);
41 // Indicates that |callback| should be called next time the app list is
42 // painted.
43 virtual void SetAppListNextPaintCallback(void (*callback)()) = 0;
45 // Perform Chrome first run logic. This is executed before Chrome's threads
46 // have been created.
47 virtual void HandleFirstRun() = 0;
49 virtual base::FilePath GetProfilePath(
50 const base::FilePath& user_data_dir) = 0;
51 virtual void SetProfilePath(const base::FilePath& profile_path) = 0;
53 // Show the app list for the profile configured in the user data dir for the
54 // current browser process.
55 virtual void Show() = 0;
57 // Create the app list UI, and maintain its state, but do not show it.
58 virtual void CreateForProfile(Profile* requested_profile) = 0;
60 // Show the app list for the given profile. If it differs from the profile the
61 // app list is currently showing, repopulate the app list and save the new
62 // profile to local prefs as the default app list profile.
63 virtual void ShowForProfile(Profile* requested_profile) = 0;
65 // Dismiss the app list.
66 virtual void DismissAppList() = 0;
68 // Get the profile the app list is currently showing.
69 virtual Profile* GetCurrentAppListProfile() = 0;
71 // Returns true if the app list is visible.
72 virtual bool IsAppListVisible() const = 0;
74 // Enable the app list. What this does specifically will depend on the host
75 // operating system and shell.
76 virtual void EnableAppList(Profile* initial_profile) = 0;
78 // Get the window the app list is in, or NULL if the app list isn't visible.
79 virtual gfx::NativeWindow GetAppListWindow() = 0;
81 // Returns a pointer to the platform specific AppListControllerDelegate.
82 virtual AppListControllerDelegate* GetControllerDelegate() = 0;
84 protected:
85 AppListService() {}
86 virtual ~AppListService() {}
88 // Do any once off initialization needed for the app list.
89 virtual void Init(Profile* initial_profile) = 0;
91 private:
92 DISALLOW_COPY_AND_ASSIGN(AppListService);
95 #endif // CHROME_BROWSER_UI_APP_LIST_APP_LIST_SERVICE_H_