OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_CHROMEOS_LOGIN_UI_LOGIN_DISPLAY_HOST_IMPL_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_LOGIN_UI_LOGIN_DISPLAY_HOST_IMPL_H_ |
6 #define CHROME_BROWSER_CHROMEOS_LOGIN_UI_LOGIN_DISPLAY_HOST_IMPL_H_ | 6 #define CHROME_BROWSER_CHROMEOS_LOGIN_UI_LOGIN_DISPLAY_HOST_IMPL_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
60 public chromeos::SessionManagerClient::Observer, | 60 public chromeos::SessionManagerClient::Observer, |
61 public chromeos::CrasAudioHandler::AudioObserver, | 61 public chromeos::CrasAudioHandler::AudioObserver, |
62 #if !defined(USE_ATHENA) | 62 #if !defined(USE_ATHENA) |
63 public ash::VirtualKeyboardStateObserver, | 63 public ash::VirtualKeyboardStateObserver, |
64 #endif | 64 #endif |
65 public keyboard::KeyboardControllerObserver, | 65 public keyboard::KeyboardControllerObserver, |
66 public gfx::DisplayObserver, | 66 public gfx::DisplayObserver, |
67 public views::WidgetRemovalsObserver { | 67 public views::WidgetRemovalsObserver { |
68 public: | 68 public: |
69 explicit LoginDisplayHostImpl(const gfx::Rect& background_bounds); | 69 explicit LoginDisplayHostImpl(const gfx::Rect& background_bounds); |
70 virtual ~LoginDisplayHostImpl(); | 70 ~LoginDisplayHostImpl() override; |
71 | 71 |
72 // Returns the default LoginDisplayHost instance if it has been created. | 72 // Returns the default LoginDisplayHost instance if it has been created. |
73 static LoginDisplayHost* default_host() { | 73 static LoginDisplayHost* default_host() { |
74 return default_host_; | 74 return default_host_; |
75 } | 75 } |
76 | 76 |
77 // LoginDisplayHost implementation: | 77 // LoginDisplayHost implementation: |
78 virtual LoginDisplay* CreateLoginDisplay( | 78 LoginDisplay* CreateLoginDisplay(LoginDisplay::Delegate* delegate) override; |
79 LoginDisplay::Delegate* delegate) override; | 79 gfx::NativeWindow GetNativeWindow() const override; |
80 virtual gfx::NativeWindow GetNativeWindow() const override; | 80 WebUILoginView* GetWebUILoginView() const override; |
81 virtual WebUILoginView* GetWebUILoginView() const override; | 81 void BeforeSessionStart() override; |
82 virtual void BeforeSessionStart() override; | 82 void Finalize() override; |
83 virtual void Finalize() override; | 83 void OnCompleteLogin() override; |
84 virtual void OnCompleteLogin() override; | 84 void OpenProxySettings() override; |
85 virtual void OpenProxySettings() override; | 85 void SetStatusAreaVisible(bool visible) override; |
86 virtual void SetStatusAreaVisible(bool visible) override; | 86 AutoEnrollmentController* GetAutoEnrollmentController() override; |
87 virtual AutoEnrollmentController* GetAutoEnrollmentController() override; | 87 void StartWizard(const std::string& first_screen_name) override; |
88 virtual void StartWizard(const std::string& first_screen_name) override; | 88 WizardController* GetWizardController() override; |
89 virtual WizardController* GetWizardController() override; | 89 AppLaunchController* GetAppLaunchController() override; |
90 virtual AppLaunchController* GetAppLaunchController() override; | 90 void StartUserAdding(const base::Closure& completion_callback) override; |
91 virtual void StartUserAdding( | 91 void StartSignInScreen(const LoginScreenContext& context) override; |
92 const base::Closure& completion_callback) override; | 92 void OnPreferencesChanged() override; |
93 virtual void StartSignInScreen(const LoginScreenContext& context) override; | 93 void PrewarmAuthentication() override; |
94 virtual void OnPreferencesChanged() override; | 94 void StartAppLaunch(const std::string& app_id, bool diagnostic_mode) override; |
95 virtual void PrewarmAuthentication() override; | 95 void StartDemoAppLaunch() override; |
96 virtual void StartAppLaunch(const std::string& app_id, | |
97 bool diagnostic_mode) override; | |
98 virtual void StartDemoAppLaunch() override; | |
99 | 96 |
100 // Creates WizardController instance. | 97 // Creates WizardController instance. |
101 WizardController* CreateWizardController(); | 98 WizardController* CreateWizardController(); |
102 | 99 |
103 // Called when the first browser window is created, but before it's shown. | 100 // Called when the first browser window is created, but before it's shown. |
104 void OnBrowserCreated(); | 101 void OnBrowserCreated(); |
105 | 102 |
106 // Returns instance of the OOBE WebUI. | 103 // Returns instance of the OOBE WebUI. |
107 OobeUI* GetOobeUI() const; | 104 OobeUI* GetOobeUI() const; |
108 | 105 |
109 const gfx::Rect& background_bounds() const { return background_bounds_; } | 106 const gfx::Rect& background_bounds() const { return background_bounds_; } |
110 | 107 |
111 // Trace id for ShowLoginWebUI event (since there exists at most one login | 108 // Trace id for ShowLoginWebUI event (since there exists at most one login |
112 // WebUI at a time). | 109 // WebUI at a time). |
113 static const int kShowLoginWebUIid; | 110 static const int kShowLoginWebUIid; |
114 | 111 |
115 views::Widget* login_window_for_test() { return login_window_; } | 112 views::Widget* login_window_for_test() { return login_window_; } |
116 | 113 |
117 protected: | 114 protected: |
118 // content::NotificationObserver implementation: | 115 // content::NotificationObserver implementation: |
119 virtual void Observe(int type, | 116 void Observe(int type, |
120 const content::NotificationSource& source, | 117 const content::NotificationSource& source, |
121 const content::NotificationDetails& details) override; | 118 const content::NotificationDetails& details) override; |
122 | 119 |
123 // Overridden from content::WebContentsObserver: | 120 // Overridden from content::WebContentsObserver: |
124 virtual void RenderProcessGone(base::TerminationStatus status) override; | 121 void RenderProcessGone(base::TerminationStatus status) override; |
125 | 122 |
126 // Overridden from chromeos::SessionManagerClient::Observer: | 123 // Overridden from chromeos::SessionManagerClient::Observer: |
127 virtual void EmitLoginPromptVisibleCalled() override; | 124 void EmitLoginPromptVisibleCalled() override; |
128 | 125 |
129 // Overridden from chromeos::CrasAudioHandler::AudioObserver: | 126 // Overridden from chromeos::CrasAudioHandler::AudioObserver: |
130 virtual void OnActiveOutputNodeChanged() override; | 127 void OnActiveOutputNodeChanged() override; |
131 | 128 |
132 #if !defined(USE_ATHENA) | 129 #if !defined(USE_ATHENA) |
133 // Overridden from ash::KeyboardStateObserver: | 130 // Overridden from ash::KeyboardStateObserver: |
134 virtual void OnVirtualKeyboardStateChanged(bool activated) override; | 131 void OnVirtualKeyboardStateChanged(bool activated) override; |
135 #endif | 132 #endif |
136 | 133 |
137 // Overridden from keyboard::KeyboardControllerObserver: | 134 // Overridden from keyboard::KeyboardControllerObserver: |
138 virtual void OnKeyboardBoundsChanging(const gfx::Rect& new_bounds) override; | 135 void OnKeyboardBoundsChanging(const gfx::Rect& new_bounds) override; |
139 | 136 |
140 // Overridden from gfx::DisplayObserver: | 137 // Overridden from gfx::DisplayObserver: |
141 virtual void OnDisplayAdded(const gfx::Display& new_display) override; | 138 void OnDisplayAdded(const gfx::Display& new_display) override; |
142 virtual void OnDisplayRemoved(const gfx::Display& old_display) override; | 139 void OnDisplayRemoved(const gfx::Display& old_display) override; |
143 virtual void OnDisplayMetricsChanged(const gfx::Display& display, | 140 void OnDisplayMetricsChanged(const gfx::Display& display, |
144 uint32_t changed_metrics) override; | 141 uint32_t changed_metrics) override; |
145 | 142 |
146 // Overriden from views::WidgetRemovalsObserver: | 143 // Overriden from views::WidgetRemovalsObserver: |
147 virtual void OnWillRemoveView(views::Widget* widget, | 144 void OnWillRemoveView(views::Widget* widget, views::View* view) override; |
148 views::View* view) override; | |
149 | 145 |
150 private: | 146 private: |
151 // Way to restore if renderer have crashed. | 147 // Way to restore if renderer have crashed. |
152 enum RestorePath { | 148 enum RestorePath { |
153 RESTORE_UNKNOWN, | 149 RESTORE_UNKNOWN, |
154 RESTORE_WIZARD, | 150 RESTORE_WIZARD, |
155 RESTORE_SIGN_IN, | 151 RESTORE_SIGN_IN, |
156 RESTORE_ADD_USER_INTO_SESSION, | 152 RESTORE_ADD_USER_INTO_SESSION, |
157 }; | 153 }; |
158 | 154 |
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
325 | 321 |
326 base::WeakPtrFactory<LoginDisplayHostImpl> pointer_factory_; | 322 base::WeakPtrFactory<LoginDisplayHostImpl> pointer_factory_; |
327 base::WeakPtrFactory<LoginDisplayHostImpl> animation_weak_ptr_factory_; | 323 base::WeakPtrFactory<LoginDisplayHostImpl> animation_weak_ptr_factory_; |
328 | 324 |
329 DISALLOW_COPY_AND_ASSIGN(LoginDisplayHostImpl); | 325 DISALLOW_COPY_AND_ASSIGN(LoginDisplayHostImpl); |
330 }; | 326 }; |
331 | 327 |
332 } // namespace chromeos | 328 } // namespace chromeos |
333 | 329 |
334 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_UI_LOGIN_DISPLAY_HOST_IMPL_H_ | 330 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_UI_LOGIN_DISPLAY_HOST_IMPL_H_ |
OLD | NEW |