| 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/browser_tab_strip_tracker.h" |
| 18 #include "chrome/browser/ui/browser_tab_strip_tracker_delegate.h" |
| 17 #include "chrome/browser/ui/tabs/tab_strip_model_observer.h" | 19 #include "chrome/browser/ui/tabs/tab_strip_model_observer.h" |
| 18 #include "ui/aura/window_observer.h" | 20 #include "ui/aura/window_observer.h" |
| 19 #include "ui/gfx/display_observer.h" | 21 #include "ui/gfx/display_observer.h" |
| 20 #include "ui/wm/public/activation_change_observer.h" | 22 #include "ui/wm/public/activation_change_observer.h" |
| 21 | 23 |
| 22 namespace aura { | 24 namespace aura { |
| 23 class Window; | 25 class Window; |
| 24 | 26 |
| 25 namespace client { | 27 namespace client { |
| 26 class ActivationClient; | 28 class ActivationClient; |
| 27 } | 29 } |
| 28 } // namespace aura | 30 } // namespace aura |
| 29 | 31 |
| 30 class Browser; | 32 class Browser; |
| 31 | 33 |
| 32 // BrowserStatusMonitor monitors creation/deletion of Browser and its | 34 // BrowserStatusMonitor monitors creation/deletion of Browser and its |
| 33 // TabStripModel to keep the launcher representation up to date as the | 35 // TabStripModel to keep the launcher representation up to date as the |
| 34 // active tab changes. | 36 // active tab changes. |
| 35 class BrowserStatusMonitor : public aura::client::ActivationChangeObserver, | 37 class BrowserStatusMonitor : public aura::client::ActivationChangeObserver, |
| 36 public aura::WindowObserver, | 38 public aura::WindowObserver, |
| 39 public BrowserTabStripTrackerDelegate, |
| 37 public chrome::BrowserListObserver, | 40 public chrome::BrowserListObserver, |
| 38 public gfx::DisplayObserver, | 41 public gfx::DisplayObserver, |
| 39 public TabStripModelObserver { | 42 public TabStripModelObserver { |
| 40 public: | 43 public: |
| 41 explicit BrowserStatusMonitor(ChromeLauncherController* launcher_controller); | 44 explicit BrowserStatusMonitor(ChromeLauncherController* launcher_controller); |
| 42 ~BrowserStatusMonitor() override; | 45 ~BrowserStatusMonitor() override; |
| 43 | 46 |
| 44 // A function which gets called when the current user has changed. | 47 // A function which gets called when the current user has changed. |
| 45 // Note that this function is called by the ChromeLauncherController to be | 48 // 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 | 49 // able to do the activation in a proper order - rather then setting an |
| (...skipping 10 matching lines...) Expand all Loading... |
| 57 | 60 |
| 58 // aura::client::ActivationChangeObserver overrides: | 61 // aura::client::ActivationChangeObserver overrides: |
| 59 void OnWindowActivated( | 62 void OnWindowActivated( |
| 60 aura::client::ActivationChangeObserver::ActivationReason reason, | 63 aura::client::ActivationChangeObserver::ActivationReason reason, |
| 61 aura::Window* gained_active, | 64 aura::Window* gained_active, |
| 62 aura::Window* lost_active) override; | 65 aura::Window* lost_active) override; |
| 63 | 66 |
| 64 // aura::WindowObserver overrides: | 67 // aura::WindowObserver overrides: |
| 65 void OnWindowDestroyed(aura::Window* window) override; | 68 void OnWindowDestroyed(aura::Window* window) override; |
| 66 | 69 |
| 70 // BrowserTabStripTrackerDelegate overrides: |
| 71 bool ShouldTrackBrowser(Browser* browser) override; |
| 72 |
| 67 // chrome::BrowserListObserver overrides: | 73 // chrome::BrowserListObserver overrides: |
| 68 void OnBrowserAdded(Browser* browser) override; | 74 void OnBrowserAdded(Browser* browser) override; |
| 69 void OnBrowserRemoved(Browser* browser) override; | 75 void OnBrowserRemoved(Browser* browser) override; |
| 70 | 76 |
| 71 // gfx::DisplayObserver overrides: | 77 // gfx::DisplayObserver overrides: |
| 72 void OnDisplayAdded(const gfx::Display& new_display) override; | 78 void OnDisplayAdded(const gfx::Display& new_display) override; |
| 73 void OnDisplayRemoved(const gfx::Display& old_display) override; | 79 void OnDisplayRemoved(const gfx::Display& old_display) override; |
| 74 void OnDisplayMetricsChanged(const gfx::Display& display, | 80 void OnDisplayMetricsChanged(const gfx::Display& display, |
| 75 uint32_t metrics) override; | 81 uint32_t metrics) override; |
| 76 | 82 |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 134 ScopedObserverWithDuplicatedSources<aura::client::ActivationClient, | 140 ScopedObserverWithDuplicatedSources<aura::client::ActivationClient, |
| 135 aura::client::ActivationChangeObserver> observed_activation_clients_; | 141 aura::client::ActivationChangeObserver> observed_activation_clients_; |
| 136 | 142 |
| 137 // Hold all observed root windows. | 143 // Hold all observed root windows. |
| 138 ScopedObserver<aura::Window, aura::WindowObserver> observed_root_windows_; | 144 ScopedObserver<aura::Window, aura::WindowObserver> observed_root_windows_; |
| 139 | 145 |
| 140 BrowserToAppIDMap browser_to_app_id_map_; | 146 BrowserToAppIDMap browser_to_app_id_map_; |
| 141 WebContentsToObserverMap webcontents_to_observer_map_; | 147 WebContentsToObserverMap webcontents_to_observer_map_; |
| 142 scoped_ptr<SettingsWindowObserver> settings_window_observer_; | 148 scoped_ptr<SettingsWindowObserver> settings_window_observer_; |
| 143 | 149 |
| 150 BrowserTabStripTracker browser_tab_strip_tracker_; |
| 151 |
| 144 DISALLOW_COPY_AND_ASSIGN(BrowserStatusMonitor); | 152 DISALLOW_COPY_AND_ASSIGN(BrowserStatusMonitor); |
| 145 }; | 153 }; |
| 146 | 154 |
| 147 #endif // CHROME_BROWSER_UI_ASH_LAUNCHER_BROWSER_STATUS_MONITOR_H_ | 155 #endif // CHROME_BROWSER_UI_ASH_LAUNCHER_BROWSER_STATUS_MONITOR_H_ |
| OLD | NEW |