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_BROWSER_STATUS_MONITOR_H_ | 5 #ifndef CHROME_BROWSER_UI_ASH_LAUNCHER_BROWSER_STATUS_MONITOR_H_ |
6 #define CHROME_BROWSER_UI_ASH_LAUNCHER_BROWSER_STATUS_MONITOR_H_ | 6 #define CHROME_BROWSER_UI_ASH_LAUNCHER_BROWSER_STATUS_MONITOR_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <string> | 9 #include <string> |
10 | 10 |
11 #include "ash/shelf/scoped_observer_with_duplicated_sources.h" | 11 #include "ash/shelf/scoped_observer_with_duplicated_sources.h" |
12 #include "base/basictypes.h" | 12 #include "base/basictypes.h" |
13 #include "base/compiler_specific.h" | 13 #include "base/compiler_specific.h" |
14 #include "base/scoped_observer.h" | 14 #include "base/scoped_observer.h" |
15 #include "chrome/browser/ui/ash/launcher/chrome_launcher_controller.h" | 15 #include "chrome/browser/ui/ash/launcher/chrome_launcher_controller.h" |
16 #include "chrome/browser/ui/browser_list_observer.h" | 16 #include "chrome/browser/ui/browser_list_observer.h" |
17 #include "chrome/browser/ui/tabs/tab_strip_model_observer.h" | 17 #include "chrome/browser/ui/tabs/tab_strip_model_observer.h" |
18 #include "ui/aura/window_observer.h" | 18 #include "ui/aura/window_observer.h" |
19 #include "ui/gfx/display_observer.h" | 19 #include "ui/gfx/display_observer.h" |
20 #include "ui/wm/public/activation_change_observer.h" | 20 #include "ui/wm/public/activation_change_observer.h" |
21 | 21 |
22 namespace aura { | 22 namespace aura { |
23 class Window; | 23 class Window; |
24 | 24 |
25 namespace client { | 25 namespace client { |
26 class ActivationClient; | 26 class ActivationClient; |
27 } | 27 } |
28 } // namespace aura | 28 } // namespace aura |
29 | 29 |
| 30 namespace user_manager { |
| 31 class UserID; |
| 32 } |
| 33 |
30 class Browser; | 34 class Browser; |
31 | 35 |
32 // BrowserStatusMonitor monitors creation/deletion of Browser and its | 36 // BrowserStatusMonitor monitors creation/deletion of Browser and its |
33 // TabStripModel to keep the launcher representation up to date as the | 37 // TabStripModel to keep the launcher representation up to date as the |
34 // active tab changes. | 38 // active tab changes. |
35 class BrowserStatusMonitor : public aura::client::ActivationChangeObserver, | 39 class BrowserStatusMonitor : public aura::client::ActivationChangeObserver, |
36 public aura::WindowObserver, | 40 public aura::WindowObserver, |
37 public chrome::BrowserListObserver, | 41 public chrome::BrowserListObserver, |
38 public gfx::DisplayObserver, | 42 public gfx::DisplayObserver, |
39 public TabStripModelObserver { | 43 public TabStripModelObserver { |
40 public: | 44 public: |
41 explicit BrowserStatusMonitor(ChromeLauncherController* launcher_controller); | 45 explicit BrowserStatusMonitor(ChromeLauncherController* launcher_controller); |
42 ~BrowserStatusMonitor() override; | 46 ~BrowserStatusMonitor() override; |
43 | 47 |
44 // A function which gets called when the current user has changed. | 48 // A function which gets called when the current user has changed. |
45 // Note that this function is called by the ChromeLauncherController to be | 49 // Note that this function is called by the ChromeLauncherController to be |
46 // able to do the activation in a proper order - rather then setting an | 50 // able to do the activation in a proper order - rather then setting an |
47 // observer. | 51 // observer. |
48 virtual void ActiveUserChanged(const std::string& user_email) {} | 52 virtual void ActiveUserChanged(const user_manager::UserID& user_email) {} |
49 | 53 |
50 // A shortcut to call the ChromeLauncherController's UpdateAppState(). | 54 // A shortcut to call the ChromeLauncherController's UpdateAppState(). |
51 void UpdateAppItemState(content::WebContents* contents, | 55 void UpdateAppItemState(content::WebContents* contents, |
52 ChromeLauncherController::AppState app_state); | 56 ChromeLauncherController::AppState app_state); |
53 | 57 |
54 // A shortcut to call the BrowserShortcutLauncherItemController's | 58 // A shortcut to call the BrowserShortcutLauncherItemController's |
55 // UpdateBrowserItemState(). | 59 // UpdateBrowserItemState(). |
56 void UpdateBrowserItemState(); | 60 void UpdateBrowserItemState(); |
57 | 61 |
58 // aura::client::ActivationChangeObserver overrides: | 62 // aura::client::ActivationChangeObserver overrides: |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
136 ScopedObserver<aura::Window, aura::WindowObserver> observed_root_windows_; | 140 ScopedObserver<aura::Window, aura::WindowObserver> observed_root_windows_; |
137 | 141 |
138 BrowserToAppIDMap browser_to_app_id_map_; | 142 BrowserToAppIDMap browser_to_app_id_map_; |
139 WebContentsToObserverMap webcontents_to_observer_map_; | 143 WebContentsToObserverMap webcontents_to_observer_map_; |
140 scoped_ptr<SettingsWindowObserver> settings_window_observer_; | 144 scoped_ptr<SettingsWindowObserver> settings_window_observer_; |
141 | 145 |
142 DISALLOW_COPY_AND_ASSIGN(BrowserStatusMonitor); | 146 DISALLOW_COPY_AND_ASSIGN(BrowserStatusMonitor); |
143 }; | 147 }; |
144 | 148 |
145 #endif // CHROME_BROWSER_UI_ASH_LAUNCHER_BROWSER_STATUS_MONITOR_H_ | 149 #endif // CHROME_BROWSER_UI_ASH_LAUNCHER_BROWSER_STATUS_MONITOR_H_ |
OLD | NEW |