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/launcher/scoped_observer_with_duplicated_sources.h" | 11 #include "ash/launcher/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/browser_list_observer.h" | 15 #include "chrome/browser/ui/browser_list_observer.h" |
16 #include "chrome/browser/ui/tabs/tab_strip_model_observer.h" | 16 #include "chrome/browser/ui/tabs/tab_strip_model_observer.h" |
17 #include "ui/aura/client/activation_change_observer.h" | 17 #include "ui/aura/client/activation_change_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 | 20 |
21 namespace aura { | 21 namespace aura { |
22 class Window; | 22 class Window; |
23 | 23 |
24 namespace client { | 24 namespace client { |
25 class ActivationClient; | 25 class ActivationClient; |
26 } | 26 } |
27 } // namespace aura | 27 } // namespace aura |
28 | 28 |
29 class Browser; | 29 class Browser; |
| 30 class BrowserShortcutLauncherItemController; |
30 class ChromeLauncherController; | 31 class ChromeLauncherController; |
31 | 32 |
32 // BrowserStatusMonitor monitors creation/deletion of Browser and its | 33 // BrowserStatusMonitor monitors creation/deletion of Browser and its |
33 // TabStripModel to keep the launcher representation up to date as the | 34 // TabStripModel to keep the launcher representation up to date as the |
34 // active tab changes. | 35 // active tab changes. |
35 class BrowserStatusMonitor : public aura::client::ActivationChangeObserver, | 36 class BrowserStatusMonitor : public aura::client::ActivationChangeObserver, |
36 public aura::WindowObserver, | 37 public aura::WindowObserver, |
37 public chrome::BrowserListObserver, | 38 public chrome::BrowserListObserver, |
38 public gfx::DisplayObserver, | 39 public gfx::DisplayObserver, |
39 public TabStripModelObserver { | 40 public TabStripModelObserver { |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
75 content::WebContents* old_contents, | 76 content::WebContents* old_contents, |
76 content::WebContents* new_contents, | 77 content::WebContents* new_contents, |
77 int index) OVERRIDE; | 78 int index) OVERRIDE; |
78 | 79 |
79 private: | 80 private: |
80 typedef std::map<Browser*, std::string> BrowserToAppIDMap; | 81 typedef std::map<Browser*, std::string> BrowserToAppIDMap; |
81 | 82 |
82 // Update app state for |contents|. | 83 // Update app state for |contents|. |
83 void UpdateAppState(content::WebContents* contents); | 84 void UpdateAppState(content::WebContents* contents); |
84 | 85 |
| 86 BrowserShortcutLauncherItemController* |
| 87 GetBrowserShortcutLauncherItemController(); |
| 88 |
85 ChromeLauncherController* launcher_controller_; | 89 ChromeLauncherController* launcher_controller_; |
86 | 90 |
87 // Hold all observed activation clients. | 91 // Hold all observed activation clients. |
88 ScopedObserverWithDuplicatedSources<aura::client::ActivationClient, | 92 ScopedObserverWithDuplicatedSources<aura::client::ActivationClient, |
89 aura::client::ActivationChangeObserver> observed_activation_clients_; | 93 aura::client::ActivationChangeObserver> observed_activation_clients_; |
90 | 94 |
91 // Hold all observed root windows. | 95 // Hold all observed root windows. |
92 ScopedObserver<aura::Window, aura::WindowObserver> observed_root_windows_; | 96 ScopedObserver<aura::Window, aura::WindowObserver> observed_root_windows_; |
93 | 97 |
94 BrowserToAppIDMap browser_to_app_id_map_; | 98 BrowserToAppIDMap browser_to_app_id_map_; |
95 | 99 |
96 DISALLOW_COPY_AND_ASSIGN(BrowserStatusMonitor); | 100 DISALLOW_COPY_AND_ASSIGN(BrowserStatusMonitor); |
97 }; | 101 }; |
98 | 102 |
99 #endif // CHROME_BROWSER_UI_ASH_LAUNCHER_BROWSER_STATUS_MONITOR_H_ | 103 #endif // CHROME_BROWSER_UI_ASH_LAUNCHER_BROWSER_STATUS_MONITOR_H_ |
OLD | NEW |