OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CHROME_BROWSER_UI_ASH_LAUNCHER_CHROME_LAUNCHER_CONTROLLER_H_ | 5 #ifndef CHROME_BROWSER_UI_ASH_LAUNCHER_CHROME_LAUNCHER_CONTROLLER_H_ |
6 #define CHROME_BROWSER_UI_ASH_LAUNCHER_CHROME_LAUNCHER_CONTROLLER_H_ | 6 #define CHROME_BROWSER_UI_ASH_LAUNCHER_CHROME_LAUNCHER_CONTROLLER_H_ |
7 | 7 |
8 #include <list> | 8 #include <list> |
9 #include <map> | 9 #include <map> |
10 #include <set> | 10 #include <set> |
11 #include <string> | 11 #include <string> |
12 #include <vector> | 12 #include <vector> |
13 | 13 |
14 #include "ash/display/display_controller.h" | 14 #include "ash/display/display_controller.h" |
15 #include "ash/launcher/launcher_delegate.h" | 15 #include "ash/launcher/launcher_delegate.h" |
16 #include "ash/launcher/launcher_types.h" | 16 #include "ash/launcher/launcher_types.h" |
17 #include "ash/shelf/shelf_item_delegate.h" | 17 #include "ash/shelf/shelf_item_delegate.h" |
18 #include "ash/shelf/shelf_layout_manager_observer.h" | 18 #include "ash/shelf/shelf_layout_manager_observer.h" |
19 #include "ash/shelf/shelf_model_observer.h" | 19 #include "ash/shelf/shelf_model_observer.h" |
20 #include "ash/shelf/shelf_types.h" | 20 #include "ash/shelf/shelf_types.h" |
21 #include "ash/shell_observer.h" | 21 #include "ash/shell_observer.h" |
22 #include "base/basictypes.h" | 22 #include "base/basictypes.h" |
23 #include "base/compiler_specific.h" | 23 #include "base/compiler_specific.h" |
24 #include "base/memory/scoped_ptr.h" | 24 #include "base/memory/scoped_ptr.h" |
25 #include "base/memory/scoped_vector.h" | 25 #include "base/memory/scoped_vector.h" |
26 #include "base/prefs/pref_change_registrar.h" | 26 #include "base/prefs/pref_change_registrar.h" |
27 #include "chrome/browser/extensions/app_icon_loader.h" | 27 #include "chrome/browser/extensions/app_icon_loader.h" |
28 #include "chrome/browser/extensions/extension_prefs.h" | 28 #include "chrome/browser/extensions/launch_util.h" |
29 #include "chrome/browser/prefs/pref_service_syncable_observer.h" | 29 #include "chrome/browser/prefs/pref_service_syncable_observer.h" |
30 #include "chrome/browser/ui/ash/app_sync_ui_state_observer.h" | 30 #include "chrome/browser/ui/ash/app_sync_ui_state_observer.h" |
31 #include "chrome/browser/ui/ash/launcher/chrome_launcher_app_menu_item.h" | 31 #include "chrome/browser/ui/ash/launcher/chrome_launcher_app_menu_item.h" |
32 #include "chrome/browser/ui/ash/launcher/chrome_launcher_types.h" | 32 #include "chrome/browser/ui/ash/launcher/chrome_launcher_types.h" |
33 #include "chrome/browser/ui/extensions/extension_enable_flow_delegate.h" | 33 #include "chrome/browser/ui/extensions/extension_enable_flow_delegate.h" |
34 #include "content/public/browser/notification_observer.h" | 34 #include "content/public/browser/notification_observer.h" |
35 #include "content/public/browser/notification_registrar.h" | 35 #include "content/public/browser/notification_registrar.h" |
36 #include "ui/aura/window_observer.h" | 36 #include "ui/aura/window_observer.h" |
37 | 37 |
38 class AppSyncUIState; | 38 class AppSyncUIState; |
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
206 int event_flags); | 206 int event_flags); |
207 | 207 |
208 // If |app_id| is running, reactivates the app's most recently active window, | 208 // If |app_id| is running, reactivates the app's most recently active window, |
209 // otherwise launches and activates the app. | 209 // otherwise launches and activates the app. |
210 // Used by the app-list, and by pinned-app launcher items. | 210 // Used by the app-list, and by pinned-app launcher items. |
211 void ActivateApp(const std::string& app_id, | 211 void ActivateApp(const std::string& app_id, |
212 ash::LaunchSource source, | 212 ash::LaunchSource source, |
213 int event_flags); | 213 int event_flags); |
214 | 214 |
215 // Returns the launch type of app for the specified id. | 215 // Returns the launch type of app for the specified id. |
216 extensions::ExtensionPrefs::LaunchType GetLaunchType(ash::LauncherID id); | 216 extensions::LaunchType GetLaunchType(ash::LauncherID id); |
217 | 217 |
218 // Set the image for a specific launcher item (e.g. when set by the app). | 218 // Set the image for a specific launcher item (e.g. when set by the app). |
219 void SetLauncherItemImage(ash::LauncherID launcher_id, | 219 void SetLauncherItemImage(ash::LauncherID launcher_id, |
220 const gfx::ImageSkia& image); | 220 const gfx::ImageSkia& image); |
221 | 221 |
222 // Find out if the given application |id| is a windowed app item and not a | 222 // Find out if the given application |id| is a windowed app item and not a |
223 // pinned item in the launcher. | 223 // pinned item in the launcher. |
224 bool IsWindowedAppInLauncher(const std::string& app_id); | 224 bool IsWindowedAppInLauncher(const std::string& app_id); |
225 | 225 |
226 // Updates the launche type of the app for the specified id to |launch_type|. | 226 // Updates the launch type of the app for the specified id to |launch_type|. |
227 void SetLaunchType(ash::LauncherID id, | 227 void SetLaunchType(ash::LauncherID id, |
228 extensions::ExtensionPrefs::LaunchType launch_type); | 228 extensions::LaunchType launch_type); |
229 | 229 |
230 // Returns true if the user is currently logged in as a guest. | 230 // Returns true if the user is currently logged in as a guest. |
231 // Makes virtual for unittest in LauncherContextMenuTest. | 231 // Makes virtual for unittest in LauncherContextMenuTest. |
232 virtual bool IsLoggedInAsGuest(); | 232 virtual bool IsLoggedInAsGuest(); |
233 | 233 |
234 // Invoked when user clicks on button in the launcher and there is no last | 234 // Invoked when user clicks on button in the launcher and there is no last |
235 // used window (or CTRL is held with the click). | 235 // used window (or CTRL is held with the click). |
236 void CreateNewWindow(); | 236 void CreateNewWindow(); |
237 | 237 |
238 // Invoked when the user clicks on button in the launcher to create a new | 238 // Invoked when the user clicks on button in the launcher to create a new |
(...skipping 344 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
583 // If true, incoming pinned state changes should be ignored. | 583 // If true, incoming pinned state changes should be ignored. |
584 bool ignore_persist_pinned_state_change_; | 584 bool ignore_persist_pinned_state_change_; |
585 | 585 |
586 // True if each user has an own desktop. | 586 // True if each user has an own desktop. |
587 bool multi_profile_desktop_separation_; | 587 bool multi_profile_desktop_separation_; |
588 | 588 |
589 DISALLOW_COPY_AND_ASSIGN(ChromeLauncherController); | 589 DISALLOW_COPY_AND_ASSIGN(ChromeLauncherController); |
590 }; | 590 }; |
591 | 591 |
592 #endif // CHROME_BROWSER_UI_ASH_LAUNCHER_CHROME_LAUNCHER_CONTROLLER_H_ | 592 #endif // CHROME_BROWSER_UI_ASH_LAUNCHER_CHROME_LAUNCHER_CONTROLLER_H_ |
OLD | NEW |