| 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 "ash/audio/sounds.h" | 9 #include "ash/audio/sounds.h" |
| 10 #include "ash/desktop_background/desktop_background_controller.h" | 10 #include "ash/desktop_background/desktop_background_controller.h" |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 64 #include "chromeos/chromeos_switches.h" | 64 #include "chromeos/chromeos_switches.h" |
| 65 #include "chromeos/dbus/dbus_thread_manager.h" | 65 #include "chromeos/dbus/dbus_thread_manager.h" |
| 66 #include "chromeos/dbus/session_manager_client.h" | 66 #include "chromeos/dbus/session_manager_client.h" |
| 67 #include "chromeos/ime/extension_ime_util.h" | 67 #include "chromeos/ime/extension_ime_util.h" |
| 68 #include "chromeos/ime/input_method_manager.h" | 68 #include "chromeos/ime/input_method_manager.h" |
| 69 #include "chromeos/login/login_state.h" | 69 #include "chromeos/login/login_state.h" |
| 70 #include "chromeos/settings/timezone_settings.h" | 70 #include "chromeos/settings/timezone_settings.h" |
| 71 #include "components/session_manager/core/session_manager.h" | 71 #include "components/session_manager/core/session_manager.h" |
| 72 #include "content/public/browser/notification_service.h" | 72 #include "content/public/browser/notification_service.h" |
| 73 #include "content/public/browser/notification_types.h" | 73 #include "content/public/browser/notification_types.h" |
| 74 #include "content/public/browser/render_frame_host.h" | |
| 75 #include "content/public/browser/web_contents.h" | 74 #include "content/public/browser/web_contents.h" |
| 76 #include "content/public/browser/web_ui.h" | 75 #include "content/public/browser/web_ui.h" |
| 77 #include "grit/browser_resources.h" | 76 #include "grit/browser_resources.h" |
| 78 #include "media/audio/sounds/sounds_manager.h" | 77 #include "media/audio/sounds/sounds_manager.h" |
| 79 #include "ui/aura/window.h" | 78 #include "ui/aura/window.h" |
| 80 #include "ui/base/resource/resource_bundle.h" | 79 #include "ui/base/resource/resource_bundle.h" |
| 81 #include "ui/base/ui_base_switches_util.h" | 80 #include "ui/base/ui_base_switches_util.h" |
| 82 #include "ui/compositor/layer.h" | 81 #include "ui/compositor/layer.h" |
| 83 #include "ui/compositor/layer_animation_observer.h" | 82 #include "ui/compositor/layer_animation_observer.h" |
| 84 #include "ui/compositor/scoped_layer_animation_settings.h" | 83 #include "ui/compositor/scoped_layer_animation_settings.h" |
| (...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 201 LOG(WARNING) << "Locale could not be found for '" << locale << "'"; | 200 LOG(WARNING) << "Locale could not be found for '" << locale << "'"; |
| 202 | 201 |
| 203 ShowLoginWizardFinish( | 202 ShowLoginWizardFinish( |
| 204 self->first_screen_name, self->startup_manifest, self->display_host); | 203 self->first_screen_name, self->startup_manifest, self->display_host); |
| 205 } | 204 } |
| 206 | 205 |
| 207 void EnableSystemSoundsForAccessibility() { | 206 void EnableSystemSoundsForAccessibility() { |
| 208 chromeos::AccessibilityManager::Get()->EnableSystemSounds(true); | 207 chromeos::AccessibilityManager::Get()->EnableSystemSounds(true); |
| 209 } | 208 } |
| 210 | 209 |
| 211 void AddToSetIfIsGaiaAuthIframe(std::set<content::RenderFrameHost*>* frame_set, | |
| 212 content::RenderFrameHost* frame) { | |
| 213 content::RenderFrameHost* parent = frame->GetParent(); | |
| 214 if (parent && parent->GetFrameName() == "signin-frame") | |
| 215 frame_set->insert(frame); | |
| 216 } | |
| 217 | |
| 218 // A login implementation of WidgetDelegate. | 210 // A login implementation of WidgetDelegate. |
| 219 class LoginWidgetDelegate : public views::WidgetDelegate { | 211 class LoginWidgetDelegate : public views::WidgetDelegate { |
| 220 public: | 212 public: |
| 221 explicit LoginWidgetDelegate(views::Widget* widget) : widget_(widget) { | 213 explicit LoginWidgetDelegate(views::Widget* widget) : widget_(widget) { |
| 222 } | 214 } |
| 223 virtual ~LoginWidgetDelegate() {} | 215 virtual ~LoginWidgetDelegate() {} |
| 224 | 216 |
| 225 // Overridden from WidgetDelegate: | 217 // Overridden from WidgetDelegate: |
| 226 virtual void DeleteDelegate() OVERRIDE { | 218 virtual void DeleteDelegate() OVERRIDE { |
| 227 delete this; | 219 delete this; |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 260 } // namespace | 252 } // namespace |
| 261 | 253 |
| 262 namespace chromeos { | 254 namespace chromeos { |
| 263 | 255 |
| 264 // static | 256 // static |
| 265 LoginDisplayHost* LoginDisplayHostImpl::default_host_ = NULL; | 257 LoginDisplayHost* LoginDisplayHostImpl::default_host_ = NULL; |
| 266 | 258 |
| 267 // static | 259 // static |
| 268 const int LoginDisplayHostImpl::kShowLoginWebUIid = 0x1111; | 260 const int LoginDisplayHostImpl::kShowLoginWebUIid = 0x1111; |
| 269 | 261 |
| 270 // static | |
| 271 content::RenderFrameHost* LoginDisplayHostImpl::GetGaiaAuthIframe( | |
| 272 content::WebContents* web_contents) { | |
| 273 std::set<content::RenderFrameHost*> frame_set; | |
| 274 web_contents->ForEachFrame( | |
| 275 base::Bind(&AddToSetIfIsGaiaAuthIframe, &frame_set)); | |
| 276 DCHECK_EQ(1U, frame_set.size()); | |
| 277 return *frame_set.begin(); | |
| 278 } | |
| 279 | |
| 280 //////////////////////////////////////////////////////////////////////////////// | 262 //////////////////////////////////////////////////////////////////////////////// |
| 281 // LoginDisplayHostImpl, public | 263 // LoginDisplayHostImpl, public |
| 282 | 264 |
| 283 LoginDisplayHostImpl::LoginDisplayHostImpl(const gfx::Rect& background_bounds) | 265 LoginDisplayHostImpl::LoginDisplayHostImpl(const gfx::Rect& background_bounds) |
| 284 : background_bounds_(background_bounds), | 266 : background_bounds_(background_bounds), |
| 285 pointer_factory_(this), | 267 pointer_factory_(this), |
| 286 shutting_down_(false), | 268 shutting_down_(false), |
| 287 oobe_progress_bar_visible_(false), | 269 oobe_progress_bar_visible_(false), |
| 288 session_starting_(false), | 270 session_starting_(false), |
| 289 login_window_(NULL), | 271 login_window_(NULL), |
| (...skipping 983 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1273 scoped_ptr<locale_util::SwitchLanguageCallback> callback( | 1255 scoped_ptr<locale_util::SwitchLanguageCallback> callback( |
| 1274 new locale_util::SwitchLanguageCallback( | 1256 new locale_util::SwitchLanguageCallback( |
| 1275 base::Bind(&OnLanguageSwitchedCallback, base::Passed(data.Pass())))); | 1257 base::Bind(&OnLanguageSwitchedCallback, base::Passed(data.Pass())))); |
| 1276 | 1258 |
| 1277 // Load locale keyboards here. Hardware layout would be automatically enabled. | 1259 // Load locale keyboards here. Hardware layout would be automatically enabled. |
| 1278 locale_util::SwitchLanguage( | 1260 locale_util::SwitchLanguage( |
| 1279 locale, true, true /* login_layouts_only */, callback.Pass()); | 1261 locale, true, true /* login_layouts_only */, callback.Pass()); |
| 1280 } | 1262 } |
| 1281 | 1263 |
| 1282 } // namespace chromeos | 1264 } // namespace chromeos |
| OLD | NEW |