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 #include "chrome/browser/chromeos/login/ui/login_display_host_impl.h" | 5 #include "chrome/browser/chromeos/login/ui/login_display_host_impl.h" |
6 | 6 |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
140 // after the login screen is initialized. This makes sure that device policy | 140 // after the login screen is initialized. This makes sure that device policy |
141 // network requests are made while the system is idle waiting for user input. | 141 // network requests are made while the system is idle waiting for user input. |
142 const int64 kPolicyServiceInitializationDelayMilliseconds = 100; | 142 const int64 kPolicyServiceInitializationDelayMilliseconds = 100; |
143 | 143 |
144 // A class to observe an implicit animation and invokes the callback after the | 144 // A class to observe an implicit animation and invokes the callback after the |
145 // animation is completed. | 145 // animation is completed. |
146 class AnimationObserver : public ui::ImplicitAnimationObserver { | 146 class AnimationObserver : public ui::ImplicitAnimationObserver { |
147 public: | 147 public: |
148 explicit AnimationObserver(const base::Closure& callback) | 148 explicit AnimationObserver(const base::Closure& callback) |
149 : callback_(callback) {} | 149 : callback_(callback) {} |
150 virtual ~AnimationObserver() {} | 150 ~AnimationObserver() override {} |
151 | 151 |
152 private: | 152 private: |
153 // ui::ImplicitAnimationObserver implementation: | 153 // ui::ImplicitAnimationObserver implementation: |
154 virtual void OnImplicitAnimationsCompleted() override { | 154 void OnImplicitAnimationsCompleted() override { |
155 callback_.Run(); | 155 callback_.Run(); |
156 delete this; | 156 delete this; |
157 } | 157 } |
158 | 158 |
159 base::Closure callback_; | 159 base::Closure callback_; |
160 | 160 |
161 DISALLOW_COPY_AND_ASSIGN(AnimationObserver); | 161 DISALLOW_COPY_AND_ASSIGN(AnimationObserver); |
162 }; | 162 }; |
163 | 163 |
164 // ShowLoginWizard is split into two parts. This function is sometimes called | 164 // ShowLoginWizard is split into two parts. This function is sometimes called |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
213 | 213 |
214 void EnableSystemSoundsForAccessibility() { | 214 void EnableSystemSoundsForAccessibility() { |
215 chromeos::AccessibilityManager::Get()->EnableSystemSounds(true); | 215 chromeos::AccessibilityManager::Get()->EnableSystemSounds(true); |
216 } | 216 } |
217 | 217 |
218 // A login implementation of WidgetDelegate. | 218 // A login implementation of WidgetDelegate. |
219 class LoginWidgetDelegate : public views::WidgetDelegate { | 219 class LoginWidgetDelegate : public views::WidgetDelegate { |
220 public: | 220 public: |
221 explicit LoginWidgetDelegate(views::Widget* widget) : widget_(widget) { | 221 explicit LoginWidgetDelegate(views::Widget* widget) : widget_(widget) { |
222 } | 222 } |
223 virtual ~LoginWidgetDelegate() {} | 223 ~LoginWidgetDelegate() override {} |
224 | 224 |
225 // Overridden from WidgetDelegate: | 225 // Overridden from WidgetDelegate: |
226 virtual void DeleteDelegate() override { | 226 void DeleteDelegate() override { delete this; } |
227 delete this; | 227 views::Widget* GetWidget() override { return widget_; } |
228 } | 228 const views::Widget* GetWidget() const override { return widget_; } |
229 virtual views::Widget* GetWidget() override { | 229 bool CanActivate() const override { return true; } |
230 return widget_; | 230 bool ShouldAdvanceFocusToTopLevelWidget() const override { return true; } |
231 } | |
232 virtual const views::Widget* GetWidget() const override { | |
233 return widget_; | |
234 } | |
235 virtual bool CanActivate() const override { | |
236 return true; | |
237 } | |
238 virtual bool ShouldAdvanceFocusToTopLevelWidget() const override { | |
239 return true; | |
240 } | |
241 | 231 |
242 private: | 232 private: |
243 views::Widget* widget_; | 233 views::Widget* widget_; |
244 | 234 |
245 DISALLOW_COPY_AND_ASSIGN(LoginWidgetDelegate); | 235 DISALLOW_COPY_AND_ASSIGN(LoginWidgetDelegate); |
246 }; | 236 }; |
247 | 237 |
248 // Disables virtual keyboard overscroll. Login UI will scroll user pods | 238 // Disables virtual keyboard overscroll. Login UI will scroll user pods |
249 // into view on JS side when virtual keyboard is shown. | 239 // into view on JS side when virtual keyboard is shown. |
250 void DisableKeyboardOverscroll() { | 240 void DisableKeyboardOverscroll() { |
(...skipping 1024 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1275 | 1265 |
1276 locale_util::SwitchLanguageCallback callback( | 1266 locale_util::SwitchLanguageCallback callback( |
1277 base::Bind(&OnLanguageSwitchedCallback, base::Passed(data.Pass()))); | 1267 base::Bind(&OnLanguageSwitchedCallback, base::Passed(data.Pass()))); |
1278 | 1268 |
1279 // Load locale keyboards here. Hardware layout would be automatically enabled. | 1269 // Load locale keyboards here. Hardware layout would be automatically enabled. |
1280 locale_util::SwitchLanguage( | 1270 locale_util::SwitchLanguage( |
1281 locale, true, true /* login_layouts_only */, callback); | 1271 locale, true, true /* login_layouts_only */, callback); |
1282 } | 1272 } |
1283 | 1273 |
1284 } // namespace chromeos | 1274 } // namespace chromeos |
OLD | NEW |