app_list_controller_delegate.h revision 3551c9c881056c480085172ff9840cab31610854
1// Copyright 2012 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_CONTROLLER_DELEGATE_H_
6#define CHROME_BROWSER_UI_APP_LIST_APP_LIST_CONTROLLER_DELEGATE_H_
7
8#include <string>
9
10#include "ui/gfx/native_widget_types.h"
11
12class Profile;
13
14namespace extensions {
15class Extension;
16}
17
18namespace gfx {
19class ImageSkia;
20}
21
22// Interface to allow the view delegate to call out to whatever is controlling
23// the app list. This will have different implementations for different
24// platforms.
25class AppListControllerDelegate {
26 public:
27  virtual ~AppListControllerDelegate();
28
29  // Dismisses the view.
30  virtual void DismissView() = 0;
31
32  // Handle the view being closed.
33  virtual void ViewClosing();
34
35  // Get app list window.
36  virtual gfx::NativeWindow GetAppListWindow() = 0;
37
38  // Get the application icon to be used, if any, for the app list.
39  virtual gfx::ImageSkia GetWindowIcon();
40
41  // Control of pinning apps.
42  virtual bool IsAppPinned(const std::string& extension_id);
43  virtual void PinApp(const std::string& extension_id);
44  virtual void UnpinApp(const std::string& extension_id);
45  virtual bool CanPin() = 0;
46
47  // Be aware of the extension prompt (either uninstalling flow or enable flow).
48  virtual void OnShowExtensionPrompt() {}
49  virtual void OnCloseExtensionPrompt() {}
50
51  // Whether the controller supports a Create Shortcuts flow.
52  virtual bool CanDoCreateShortcutsFlow(bool is_platform_app) = 0;
53  virtual void DoCreateShortcutsFlow(Profile* profile,
54                                     const std::string& extension_id);
55
56  // Handle the "create window" context menu items of Chrome App.
57  // |incognito| is true to create an incognito window.
58  virtual void CreateNewWindow(Profile* profile, bool incognito);
59
60  // Show the app's most recent window, or launch it if it is not running.
61  virtual void ActivateApp(Profile* profile,
62                           const extensions::Extension* extension,
63                           int event_flags) = 0;
64
65  // Launch the app.
66  virtual void LaunchApp(Profile* profile,
67                         const extensions::Extension* extension,
68                         int event_flags) = 0;
69
70  // Whether or not the icon indicating which user is logged in should be
71  // visible.
72  virtual bool ShouldShowUserIcon();
73};
74
75#endif  // CHROME_BROWSER_UI_APP_LIST_APP_LIST_CONTROLLER_DELEGATE_H_
76