| OLD | NEW |
| (Empty) |
| 1 // Copyright (c) 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_H_ | |
| 6 #define CHROME_BROWSER_UI_APP_LIST_APP_LIST_CONTROLLER_H_ | |
| 7 | |
| 8 #include <string> | |
| 9 | |
| 10 class Profile; | |
| 11 | |
| 12 // Interface to allow the view delegate to call out to whatever is controlling | |
| 13 // the app list. This will have different implementations for different | |
| 14 // platforms. | |
| 15 class AppListControllerDelegate { | |
| 16 public: | |
| 17 virtual ~AppListControllerDelegate(); | |
| 18 | |
| 19 // Dismisses the view. | |
| 20 virtual void DismissView() = 0; | |
| 21 | |
| 22 // Handle the view being closed. | |
| 23 virtual void ViewClosing(); | |
| 24 | |
| 25 // Handle the view being activated or deactivated. | |
| 26 virtual void ViewActivationChanged(bool active); | |
| 27 | |
| 28 // Control of pinning apps. | |
| 29 virtual bool IsAppPinned(const std::string& extension_id); | |
| 30 virtual void PinApp(const std::string& extension_id); | |
| 31 virtual void UnpinApp(const std::string& extension_id); | |
| 32 virtual bool CanPin() = 0; | |
| 33 | |
| 34 // Be aware of the extension uninstalling flow. | |
| 35 virtual void AboutToUninstallApp() {} | |
| 36 virtual void UninstallAppCompleted() {} | |
| 37 | |
| 38 // Whether the controller supports showing the Create Shortcuts dialog. | |
| 39 virtual bool CanShowCreateShortcutsDialog() = 0; | |
| 40 virtual void ShowCreateShortcutsDialog(Profile* profile, | |
| 41 const std::string& extension_id); | |
| 42 | |
| 43 // Handle the "create window" context menu items of Chrome App. | |
| 44 // |incognito| is true to create an incognito window. | |
| 45 virtual void CreateNewWindow(bool incognito); | |
| 46 | |
| 47 // Show the app's most recent window, or launch it if it is not running. | |
| 48 virtual void ActivateApp(Profile* profile, | |
| 49 const std::string& extension_id, | |
| 50 int event_flags) = 0; | |
| 51 | |
| 52 // Launch the app. | |
| 53 virtual void LaunchApp(Profile* profile, | |
| 54 const std::string& extension_id, | |
| 55 int event_flags) = 0; | |
| 56 }; | |
| 57 | |
| 58 namespace app_list_controller { | |
| 59 | |
| 60 // Do any once off initialization needed for the app list. | |
| 61 void InitAppList(); | |
| 62 | |
| 63 // Show the app list. | |
| 64 void ShowAppList(); | |
| 65 | |
| 66 } // namespace app_list_controller | |
| 67 | |
| 68 #endif // CHROME_BROWSER_UI_APP_LIST_APP_LIST_CONTROLLER_H_ | |
| OLD | NEW |