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> |
(...skipping 13 matching lines...) Expand all Loading... |
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/prefs/pref_service_syncable_observer.h" | 28 #include "chrome/browser/prefs/pref_service_syncable_observer.h" |
29 #include "chrome/browser/ui/ash/app_sync_ui_state_observer.h" | 29 #include "chrome/browser/ui/ash/app_sync_ui_state_observer.h" |
30 #include "chrome/browser/ui/ash/launcher/chrome_launcher_app_menu_item.h" | 30 #include "chrome/browser/ui/ash/launcher/chrome_launcher_app_menu_item.h" |
31 #include "chrome/browser/ui/ash/launcher/chrome_launcher_types.h" | 31 #include "chrome/browser/ui/ash/launcher/chrome_launcher_types.h" |
32 #include "chrome/browser/ui/extensions/extension_enable_flow_delegate.h" | 32 #include "chrome/browser/ui/extensions/extension_enable_flow_delegate.h" |
33 #include "chrome/common/extensions/extension_constants.h" | 33 #include "chrome/common/extensions/extension_constants.h" |
34 #include "content/public/browser/notification_observer.h" | 34 #include "extensions/browser/extension_registry_observer.h" |
35 #include "content/public/browser/notification_registrar.h" | |
36 #include "ui/aura/window_observer.h" | 35 #include "ui/aura/window_observer.h" |
37 | 36 |
38 class AppSyncUIState; | 37 class AppSyncUIState; |
39 class Browser; | 38 class Browser; |
40 class BrowserShortcutLauncherItemController; | 39 class BrowserShortcutLauncherItemController; |
41 class BrowserStatusMonitor; | 40 class BrowserStatusMonitor; |
42 class ExtensionEnableFlow; | 41 class ExtensionEnableFlow; |
43 class GURL; | 42 class GURL; |
44 class LauncherItemController; | 43 class LauncherItemController; |
45 class Profile; | 44 class Profile; |
46 class AppWindowLauncherController; | 45 class AppWindowLauncherController; |
47 class TabContents; | 46 class TabContents; |
48 | 47 |
49 namespace ash { | 48 namespace ash { |
50 class ShelfItemDelegateManager; | 49 class ShelfItemDelegateManager; |
51 class ShelfModel; | 50 class ShelfModel; |
52 } | 51 } |
53 | 52 |
54 namespace aura { | 53 namespace aura { |
55 class Window; | 54 class Window; |
56 } | 55 } |
57 | 56 |
58 namespace content { | 57 namespace content { |
59 class WebContents; | 58 class WebContents; |
60 } | 59 } |
61 | 60 |
62 namespace extensions { | 61 namespace extensions { |
63 class Extension; | 62 class Extension; |
| 63 class ExtensionRegistry; |
64 } | 64 } |
65 | 65 |
66 namespace ui { | 66 namespace ui { |
67 class BaseWindow; | 67 class BaseWindow; |
68 } | 68 } |
69 | 69 |
70 // A list of the elements which makes up a simple menu description. | 70 // A list of the elements which makes up a simple menu description. |
71 typedef ScopedVector<ChromeLauncherAppMenuItem> ChromeLauncherAppMenuItems; | 71 typedef ScopedVector<ChromeLauncherAppMenuItem> ChromeLauncherAppMenuItems; |
72 | 72 |
73 // A class which needs to be overwritten dependent on the used OS to moitor | 73 // A class which needs to be overwritten dependent on the used OS to moitor |
(...skipping 12 matching lines...) Expand all Loading... |
86 // This incarnation groups running tabs/windows in application specific lists. | 86 // This incarnation groups running tabs/windows in application specific lists. |
87 // * Browser app windows have BrowserLauncherItemController, owned by the | 87 // * Browser app windows have BrowserLauncherItemController, owned by the |
88 // BrowserView instance. | 88 // BrowserView instance. |
89 // * App windows have AppWindowLauncherItemController, owned by | 89 // * App windows have AppWindowLauncherItemController, owned by |
90 // AppWindowLauncherController. | 90 // AppWindowLauncherController. |
91 // * Shortcuts have no LauncherItemController. | 91 // * Shortcuts have no LauncherItemController. |
92 class ChromeLauncherController : public ash::ShelfDelegate, | 92 class ChromeLauncherController : public ash::ShelfDelegate, |
93 public ash::ShelfModelObserver, | 93 public ash::ShelfModelObserver, |
94 public ash::ShellObserver, | 94 public ash::ShellObserver, |
95 public ash::DisplayController::Observer, | 95 public ash::DisplayController::Observer, |
96 public content::NotificationObserver, | |
97 public extensions::AppIconLoader::Delegate, | 96 public extensions::AppIconLoader::Delegate, |
98 public PrefServiceSyncableObserver, | 97 public PrefServiceSyncableObserver, |
| 98 public extensions::ExtensionRegistryObserver, |
99 public AppSyncUIStateObserver, | 99 public AppSyncUIStateObserver, |
100 public ExtensionEnableFlowDelegate, | 100 public ExtensionEnableFlowDelegate, |
101 public ash::ShelfLayoutManagerObserver { | 101 public ash::ShelfLayoutManagerObserver { |
102 public: | 102 public: |
103 // Indicates if a shelf item is incognito or not. | 103 // Indicates if a shelf item is incognito or not. |
104 enum IncognitoState { | 104 enum IncognitoState { |
105 STATE_INCOGNITO, | 105 STATE_INCOGNITO, |
106 STATE_NOT_INCOGNITO, | 106 STATE_NOT_INCOGNITO, |
107 }; | 107 }; |
108 | 108 |
(...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
301 virtual void UnpinAppWithID(const std::string& app_id) OVERRIDE; | 301 virtual void UnpinAppWithID(const std::string& app_id) OVERRIDE; |
302 | 302 |
303 // ash::ShelfModelObserver overrides: | 303 // ash::ShelfModelObserver overrides: |
304 virtual void ShelfItemAdded(int index) OVERRIDE; | 304 virtual void ShelfItemAdded(int index) OVERRIDE; |
305 virtual void ShelfItemRemoved(int index, ash::ShelfID id) OVERRIDE; | 305 virtual void ShelfItemRemoved(int index, ash::ShelfID id) OVERRIDE; |
306 virtual void ShelfItemMoved(int start_index, int target_index) OVERRIDE; | 306 virtual void ShelfItemMoved(int start_index, int target_index) OVERRIDE; |
307 virtual void ShelfItemChanged(int index, | 307 virtual void ShelfItemChanged(int index, |
308 const ash::ShelfItem& old_item) OVERRIDE; | 308 const ash::ShelfItem& old_item) OVERRIDE; |
309 virtual void ShelfStatusChanged() OVERRIDE; | 309 virtual void ShelfStatusChanged() OVERRIDE; |
310 | 310 |
311 // content::NotificationObserver overrides: | 311 virtual void OnExtensionLoaded( |
312 virtual void Observe(int type, | 312 content::BrowserContext* browser_context, |
313 const content::NotificationSource& source, | 313 const extensions::Extension* extension) OVERRIDE; |
314 const content::NotificationDetails& details) OVERRIDE; | 314 virtual void OnExtensionUnloaded( |
| 315 content::BrowserContext* browser_context, |
| 316 const extensions::Extension* extension, |
| 317 extensions::UnloadedExtensionInfo::Reason reason) OVERRIDE; |
315 | 318 |
316 // ash::ShellObserver overrides: | 319 // ash::ShellObserver overrides: |
317 virtual void OnShelfAlignmentChanged(aura::Window* root_window) OVERRIDE; | 320 virtual void OnShelfAlignmentChanged(aura::Window* root_window) OVERRIDE; |
318 | 321 |
319 // ash::DisplayController::Observer overrides: | 322 // ash::DisplayController::Observer overrides: |
320 virtual void OnDisplayConfigurationChanged() OVERRIDE; | 323 virtual void OnDisplayConfigurationChanged() OVERRIDE; |
321 | 324 |
322 // PrefServiceSyncableObserver overrides: | 325 // PrefServiceSyncableObserver overrides: |
323 virtual void OnIsSyncingChanged() OVERRIDE; | 326 virtual void OnIsSyncingChanged() OVERRIDE; |
324 | 327 |
(...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
568 | 571 |
569 // Used to track app windows. | 572 // Used to track app windows. |
570 scoped_ptr<AppWindowLauncherController> app_window_controller_; | 573 scoped_ptr<AppWindowLauncherController> app_window_controller_; |
571 | 574 |
572 // Used to get app info for tabs. | 575 // Used to get app info for tabs. |
573 scoped_ptr<AppTabHelper> app_tab_helper_; | 576 scoped_ptr<AppTabHelper> app_tab_helper_; |
574 | 577 |
575 // Used to load the image for an app item. | 578 // Used to load the image for an app item. |
576 scoped_ptr<extensions::AppIconLoader> app_icon_loader_; | 579 scoped_ptr<extensions::AppIconLoader> app_icon_loader_; |
577 | 580 |
578 content::NotificationRegistrar notification_registrar_; | 581 // Used to get extension loaded, unloaded notifications. |
| 582 extensions::ExtensionRegistry* extension_registry_; |
579 | 583 |
580 PrefChangeRegistrar pref_change_registrar_; | 584 PrefChangeRegistrar pref_change_registrar_; |
581 | 585 |
582 AppSyncUIState* app_sync_ui_state_; | 586 AppSyncUIState* app_sync_ui_state_; |
583 | 587 |
584 scoped_ptr<ExtensionEnableFlow> extension_enable_flow_; | 588 scoped_ptr<ExtensionEnableFlow> extension_enable_flow_; |
585 | 589 |
586 // Shelves that are currently being observed. | 590 // Shelves that are currently being observed. |
587 std::set<ash::Shelf*> shelves_; | 591 std::set<ash::Shelf*> shelves_; |
588 | 592 |
(...skipping 12 matching lines...) Expand all Loading... |
601 // The list of running & un-pinned applications for different users on hidden | 605 // The list of running & un-pinned applications for different users on hidden |
602 // desktops. | 606 // desktops. |
603 typedef std::vector<std::string> RunningAppListIds; | 607 typedef std::vector<std::string> RunningAppListIds; |
604 typedef std::map<std::string, RunningAppListIds> RunningAppListIdMap; | 608 typedef std::map<std::string, RunningAppListIds> RunningAppListIdMap; |
605 RunningAppListIdMap last_used_running_application_order_; | 609 RunningAppListIdMap last_used_running_application_order_; |
606 | 610 |
607 DISALLOW_COPY_AND_ASSIGN(ChromeLauncherController); | 611 DISALLOW_COPY_AND_ASSIGN(ChromeLauncherController); |
608 }; | 612 }; |
609 | 613 |
610 #endif // CHROME_BROWSER_UI_ASH_LAUNCHER_CHROME_LAUNCHER_CONTROLLER_H_ | 614 #endif // CHROME_BROWSER_UI_ASH_LAUNCHER_CHROME_LAUNCHER_CONTROLLER_H_ |
OLD | NEW |