OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_CHROME_SHELL_DELEGATE_H_ | 5 #ifndef CHROME_BROWSER_UI_ASH_CHROME_SHELL_DELEGATE_H_ |
6 #define CHROME_BROWSER_UI_ASH_CHROME_SHELL_DELEGATE_H_ | 6 #define CHROME_BROWSER_UI_ASH_CHROME_SHELL_DELEGATE_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "ash/shelf/shelf_item_types.h" | 10 #include "ash/shelf/shelf_item_types.h" |
11 #include "ash/shell_delegate.h" | 11 #include "ash/shell_delegate.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/memory/scoped_ptr.h" | 14 #include "base/memory/scoped_ptr.h" |
15 #include "base/observer_list.h" | 15 #include "base/observer_list.h" |
16 #include "chrome/browser/ui/ash/metrics/chrome_user_metrics_recorder.h" | 16 #include "chrome/browser/ui/ash/metrics/chrome_user_metrics_recorder.h" |
17 #include "content/public/browser/notification_observer.h" | 17 #include "content/public/browser/notification_observer.h" |
18 #include "content/public/browser/notification_registrar.h" | 18 #include "content/public/browser/notification_registrar.h" |
19 | 19 |
| 20 #if defined(OS_CHROMEOS) |
| 21 #include "ash/shell_observer.h" |
| 22 #endif |
| 23 |
20 class Browser; | 24 class Browser; |
21 | 25 |
22 namespace ash { | 26 namespace ash { |
23 class ShelfItemDelegate; | 27 class ShelfItemDelegate; |
24 } | 28 } |
25 | 29 |
26 namespace content { | 30 namespace content { |
27 class WebContents; | 31 class WebContents; |
28 } | 32 } |
29 | 33 |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
79 base::string16 GetProductName() const override; | 83 base::string16 GetProductName() const override; |
80 void OpenKeyboardShortcutHelpPage() const override; | 84 void OpenKeyboardShortcutHelpPage() const override; |
81 gfx::Image GetDeprecatedAcceleratorImage() const override; | 85 gfx::Image GetDeprecatedAcceleratorImage() const override; |
82 | 86 |
83 // content::NotificationObserver override: | 87 // content::NotificationObserver override: |
84 void Observe(int type, | 88 void Observe(int type, |
85 const content::NotificationSource& source, | 89 const content::NotificationSource& source, |
86 const content::NotificationDetails& details) override; | 90 const content::NotificationDetails& details) override; |
87 | 91 |
88 private: | 92 private: |
| 93 #if defined(OS_CHROMEOS) |
| 94 // An Observer to track session state and start/stop ARC accordingly. |
| 95 class ArcSessionObserver : public ash::ShellObserver { |
| 96 public: |
| 97 ArcSessionObserver(); |
| 98 ~ArcSessionObserver() override; |
| 99 |
| 100 // ash::ShellObserver overrides: |
| 101 void OnLoginStateChanged(ash::user::LoginStatus status) override; |
| 102 |
| 103 private: |
| 104 DISALLOW_COPY_AND_ASSIGN(ArcSessionObserver); |
| 105 }; |
| 106 #endif |
| 107 |
89 void PlatformInit(); | 108 void PlatformInit(); |
90 | 109 |
91 static ChromeShellDelegate* instance_; | 110 static ChromeShellDelegate* instance_; |
92 | 111 |
93 content::NotificationRegistrar registrar_; | 112 content::NotificationRegistrar registrar_; |
94 | 113 |
95 ChromeLauncherController* shelf_delegate_; | 114 ChromeLauncherController* shelf_delegate_; |
96 | 115 |
97 base::ObserverList<ash::VirtualKeyboardStateObserver> | 116 base::ObserverList<ash::VirtualKeyboardStateObserver> |
98 keyboard_state_observer_list_; | 117 keyboard_state_observer_list_; |
99 | 118 |
100 // Proxies events from chrome/browser to ash::UserMetricsRecorder. | 119 // Proxies events from chrome/browser to ash::UserMetricsRecorder. |
101 scoped_ptr<ChromeUserMetricsRecorder> chrome_user_metrics_recorder_; | 120 scoped_ptr<ChromeUserMetricsRecorder> chrome_user_metrics_recorder_; |
102 | 121 |
103 #if defined(OS_CHROMEOS) | 122 #if defined(OS_CHROMEOS) |
104 scoped_ptr<chromeos::DisplayConfigurationObserver> | 123 scoped_ptr<chromeos::DisplayConfigurationObserver> |
105 display_configuration_observer_; | 124 display_configuration_observer_; |
| 125 |
| 126 // An Observer to track session state and start/stop ARC accordingly. |
| 127 scoped_ptr<ArcSessionObserver> arc_session_observer_; |
106 #endif | 128 #endif |
107 | 129 |
108 DISALLOW_COPY_AND_ASSIGN(ChromeShellDelegate); | 130 DISALLOW_COPY_AND_ASSIGN(ChromeShellDelegate); |
109 }; | 131 }; |
110 | 132 |
111 #endif // CHROME_BROWSER_UI_ASH_CHROME_SHELL_DELEGATE_H_ | 133 #endif // CHROME_BROWSER_UI_ASH_CHROME_SHELL_DELEGATE_H_ |
OLD | NEW |