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 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
61 } | 61 } |
62 | 62 |
63 namespace extensions { | 63 namespace extensions { |
64 class Extension; | 64 class Extension; |
65 } | 65 } |
66 | 66 |
67 namespace ui { | 67 namespace ui { |
68 class BaseWindow; | 68 class BaseWindow; |
69 } | 69 } |
70 | 70 |
| 71 namespace user_manager { |
| 72 class UserID; |
| 73 } |
| 74 |
71 // A list of the elements which makes up a simple menu description. | 75 // A list of the elements which makes up a simple menu description. |
72 typedef ScopedVector<ChromeLauncherAppMenuItem> ChromeLauncherAppMenuItems; | 76 typedef ScopedVector<ChromeLauncherAppMenuItem> ChromeLauncherAppMenuItems; |
73 | 77 |
74 // A class which needs to be overwritten dependent on the used OS to moitor | 78 // A class which needs to be overwritten dependent on the used OS to moitor |
75 // user switching. | 79 // user switching. |
76 class ChromeLauncherControllerUserSwitchObserver { | 80 class ChromeLauncherControllerUserSwitchObserver { |
77 public: | 81 public: |
78 ChromeLauncherControllerUserSwitchObserver() {} | 82 ChromeLauncherControllerUserSwitchObserver() {} |
79 virtual ~ChromeLauncherControllerUserSwitchObserver() {} | 83 virtual ~ChromeLauncherControllerUserSwitchObserver() {} |
80 | 84 |
(...skipping 265 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
346 // extensions::AppIconLoader: | 350 // extensions::AppIconLoader: |
347 void SetAppImage(const std::string& app_id, | 351 void SetAppImage(const std::string& app_id, |
348 const gfx::ImageSkia& image) override; | 352 const gfx::ImageSkia& image) override; |
349 | 353 |
350 // ash::ShelfLayoutManagerObserver: | 354 // ash::ShelfLayoutManagerObserver: |
351 void OnAutoHideBehaviorChanged( | 355 void OnAutoHideBehaviorChanged( |
352 aura::Window* root_window, | 356 aura::Window* root_window, |
353 ash::ShelfAutoHideBehavior new_behavior) override; | 357 ash::ShelfAutoHideBehavior new_behavior) override; |
354 | 358 |
355 // Called when the active user has changed. | 359 // Called when the active user has changed. |
356 void ActiveUserChanged(const std::string& user_email); | 360 void ActiveUserChanged(const user_manager::UserID& user_email); |
357 | 361 |
358 // Called when a user got added to the session. | 362 // Called when a user got added to the session. |
359 void AdditionalUserAddedToSession(Profile* profile); | 363 void AdditionalUserAddedToSession(Profile* profile); |
360 | 364 |
361 // Get the list of all running incarnations of this item. | 365 // Get the list of all running incarnations of this item. |
362 // |event_flags| specifies the flags which were set by the event which | 366 // |event_flags| specifies the flags which were set by the event which |
363 // triggered this menu generation. It can be used to generate different lists. | 367 // triggered this menu generation. It can be used to generate different lists. |
364 ChromeLauncherAppMenuItems GetApplicationList(const ash::ShelfItem& item, | 368 ChromeLauncherAppMenuItems GetApplicationList(const ash::ShelfItem& item, |
365 int event_flags); | 369 int event_flags); |
366 | 370 |
(...skipping 29 matching lines...) Expand all Loading... |
396 LauncherItemController* GetLauncherItemController(const ash::ShelfID id); | 400 LauncherItemController* GetLauncherItemController(const ash::ShelfID id); |
397 | 401 |
398 // Returns true if |browser| is owned by the active user. | 402 // Returns true if |browser| is owned by the active user. |
399 bool IsBrowserFromActiveUser(Browser* browser); | 403 bool IsBrowserFromActiveUser(Browser* browser); |
400 | 404 |
401 // Check if the shelf visibility (location, visibility) will change with a new | 405 // Check if the shelf visibility (location, visibility) will change with a new |
402 // user profile or not. However, since the full visibility calculation of the | 406 // user profile or not. However, since the full visibility calculation of the |
403 // shelf cannot be performed here, this is only a probability used for | 407 // shelf cannot be performed here, this is only a probability used for |
404 // animation predictions. | 408 // animation predictions. |
405 bool ShelfBoundsChangesProbablyWithUser(aura::Window* root_window, | 409 bool ShelfBoundsChangesProbablyWithUser(aura::Window* root_window, |
406 const std::string& user_id) const; | 410 const user_manager::UserID& user_id) c
onst; |
407 | 411 |
408 // Access to the BrowserStatusMonitor for tests. | 412 // Access to the BrowserStatusMonitor for tests. |
409 BrowserStatusMonitor* browser_status_monitor_for_test() { | 413 BrowserStatusMonitor* browser_status_monitor_for_test() { |
410 return browser_status_monitor_.get(); | 414 return browser_status_monitor_.get(); |
411 } | 415 } |
412 | 416 |
413 // Access to the AppWindowLauncherController for tests. | 417 // Access to the AppWindowLauncherController for tests. |
414 AppWindowLauncherController* app_window_controller_for_test() { | 418 AppWindowLauncherController* app_window_controller_for_test() { |
415 return app_window_controller_.get(); | 419 return app_window_controller_.get(); |
416 } | 420 } |
(...skipping 20 matching lines...) Expand all Loading... |
437 friend class ShelfAppBrowserTest; | 441 friend class ShelfAppBrowserTest; |
438 friend class LauncherPlatformAppBrowserTest; | 442 friend class LauncherPlatformAppBrowserTest; |
439 | 443 |
440 typedef std::map<ash::ShelfID, LauncherItemController*> IDToItemControllerMap; | 444 typedef std::map<ash::ShelfID, LauncherItemController*> IDToItemControllerMap; |
441 typedef std::map<content::WebContents*, std::string> WebContentsToAppIDMap; | 445 typedef std::map<content::WebContents*, std::string> WebContentsToAppIDMap; |
442 | 446 |
443 // Remembers / restores list of running applications. | 447 // Remembers / restores list of running applications. |
444 // Note that this order will neither be stored in the preference nor will it | 448 // Note that this order will neither be stored in the preference nor will it |
445 // remember the order of closed applications since it is only temporary. | 449 // remember the order of closed applications since it is only temporary. |
446 void RememberUnpinnedRunningApplicationOrder(); | 450 void RememberUnpinnedRunningApplicationOrder(); |
447 void RestoreUnpinnedRunningApplicationOrder(const std::string& user_id); | 451 void RestoreUnpinnedRunningApplicationOrder(const user_manager::UserID& user_i
d); |
448 | 452 |
449 // Creates a new app shortcut item and controller on the shelf at |index|. | 453 // Creates a new app shortcut item and controller on the shelf at |index|. |
450 // Use kInsertItemAtEnd to add a shortcut as the last item. | 454 // Use kInsertItemAtEnd to add a shortcut as the last item. |
451 ash::ShelfID CreateAppShortcutLauncherItemWithType( | 455 ash::ShelfID CreateAppShortcutLauncherItemWithType( |
452 const std::string& app_id, | 456 const std::string& app_id, |
453 int index, | 457 int index, |
454 ash::ShelfItemType shelf_item_type); | 458 ash::ShelfItemType shelf_item_type); |
455 | 459 |
456 // Invoked when the associated browser or app is closed. | 460 // Invoked when the associated browser or app is closed. |
457 void LauncherItemClosed(ash::ShelfID id); | 461 void LauncherItemClosed(ash::ShelfID id); |
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
603 | 607 |
604 // A special observer class to detect user switches. | 608 // A special observer class to detect user switches. |
605 scoped_ptr<ChromeLauncherControllerUserSwitchObserver> user_switch_observer_; | 609 scoped_ptr<ChromeLauncherControllerUserSwitchObserver> user_switch_observer_; |
606 | 610 |
607 // If true, incoming pinned state changes should be ignored. | 611 // If true, incoming pinned state changes should be ignored. |
608 bool ignore_persist_pinned_state_change_; | 612 bool ignore_persist_pinned_state_change_; |
609 | 613 |
610 // The list of running & un-pinned applications for different users on hidden | 614 // The list of running & un-pinned applications for different users on hidden |
611 // desktops. | 615 // desktops. |
612 typedef std::vector<std::string> RunningAppListIds; | 616 typedef std::vector<std::string> RunningAppListIds; |
613 typedef std::map<std::string, RunningAppListIds> RunningAppListIdMap; | 617 typedef std::map<user_manager::UserID, RunningAppListIds> RunningAppListIdMap; |
614 RunningAppListIdMap last_used_running_application_order_; | 618 RunningAppListIdMap last_used_running_application_order_; |
615 | 619 |
616 DISALLOW_COPY_AND_ASSIGN(ChromeLauncherController); | 620 DISALLOW_COPY_AND_ASSIGN(ChromeLauncherController); |
617 }; | 621 }; |
618 | 622 |
619 #endif // CHROME_BROWSER_UI_ASH_LAUNCHER_CHROME_LAUNCHER_CONTROLLER_H_ | 623 #endif // CHROME_BROWSER_UI_ASH_LAUNCHER_CHROME_LAUNCHER_CONTROLLER_H_ |
OLD | NEW |