| 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/webui_login_view.h" | 5 #include "chrome/browser/chromeos/login/ui/webui_login_view.h" |
| 6 | 6 |
| 7 #include "ash/shell.h" | 7 #include "ash/shell.h" |
| 8 #include "ash/system/tray/system_tray.h" | 8 #include "ash/system/tray/system_tray.h" |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/callback.h" | 10 #include "base/callback.h" |
| (...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 257 AccelMap::const_iterator entry = accel_map_.find(accelerator); | 257 AccelMap::const_iterator entry = accel_map_.find(accelerator); |
| 258 if (entry == accel_map_.end()) | 258 if (entry == accel_map_.end()) |
| 259 return false; | 259 return false; |
| 260 | 260 |
| 261 if (!webui_login_) | 261 if (!webui_login_) |
| 262 return true; | 262 return true; |
| 263 | 263 |
| 264 content::WebUI* web_ui = GetWebUI(); | 264 content::WebUI* web_ui = GetWebUI(); |
| 265 if (web_ui) { | 265 if (web_ui) { |
| 266 base::StringValue accel_name(entry->second); | 266 base::StringValue accel_name(entry->second); |
| 267 web_ui->CallJavascriptFunction("cr.ui.Oobe.handleAccelerator", | 267 web_ui->CallJavascriptFunctionUnsafe("cr.ui.Oobe.handleAccelerator", |
| 268 accel_name); | 268 accel_name); |
| 269 } | 269 } |
| 270 | 270 |
| 271 return true; | 271 return true; |
| 272 } | 272 } |
| 273 | 273 |
| 274 gfx::NativeWindow WebUILoginView::GetNativeWindow() const { | 274 gfx::NativeWindow WebUILoginView::GetNativeWindow() const { |
| 275 return GetWidget()->GetNativeWindow(); | 275 return GetWidget()->GetNativeWindow(); |
| 276 } | 276 } |
| 277 | 277 |
| 278 void WebUILoginView::LoadURL(const GURL & url) { | 278 void WebUILoginView::LoadURL(const GURL & url) { |
| (...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 414 unhandled_keyboard_event_handler_.HandleKeyboardEvent(event, | 414 unhandled_keyboard_event_handler_.HandleKeyboardEvent(event, |
| 415 GetFocusManager()); | 415 GetFocusManager()); |
| 416 } | 416 } |
| 417 | 417 |
| 418 // Make sure error bubble is cleared on keyboard event. This is needed | 418 // Make sure error bubble is cleared on keyboard event. This is needed |
| 419 // when the focus is inside an iframe. Only clear on KeyDown to prevent hiding | 419 // when the focus is inside an iframe. Only clear on KeyDown to prevent hiding |
| 420 // an immediate authentication error (See crbug.com/103643). | 420 // an immediate authentication error (See crbug.com/103643). |
| 421 if (event.type == blink::WebInputEvent::KeyDown) { | 421 if (event.type == blink::WebInputEvent::KeyDown) { |
| 422 content::WebUI* web_ui = GetWebUI(); | 422 content::WebUI* web_ui = GetWebUI(); |
| 423 if (web_ui) | 423 if (web_ui) |
| 424 web_ui->CallJavascriptFunction("cr.ui.Oobe.clearErrors"); | 424 web_ui->CallJavascriptFunctionUnsafe("cr.ui.Oobe.clearErrors"); |
| 425 } | 425 } |
| 426 } | 426 } |
| 427 | 427 |
| 428 bool WebUILoginView::IsPopupOrPanel(const WebContents* source) const { | 428 bool WebUILoginView::IsPopupOrPanel(const WebContents* source) const { |
| 429 return true; | 429 return true; |
| 430 } | 430 } |
| 431 | 431 |
| 432 bool WebUILoginView::TakeFocus(content::WebContents* source, bool reverse) { | 432 bool WebUILoginView::TakeFocus(content::WebContents* source, bool reverse) { |
| 433 // In case of blocked UI (ex.: sign in is in progress) | 433 // In case of blocked UI (ex.: sign in is in progress) |
| 434 // we should not process focus change events. | 434 // we should not process focus change events. |
| (...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 549 if (should_emit_login_prompt_visible_) { | 549 if (should_emit_login_prompt_visible_) { |
| 550 VLOG(1) << "Login WebUI >> login-prompt-visible"; | 550 VLOG(1) << "Login WebUI >> login-prompt-visible"; |
| 551 chromeos::DBusThreadManager::Get()->GetSessionManagerClient()-> | 551 chromeos::DBusThreadManager::Get()->GetSessionManagerClient()-> |
| 552 EmitLoginPromptVisible(); | 552 EmitLoginPromptVisible(); |
| 553 } | 553 } |
| 554 | 554 |
| 555 webui_visible_ = true; | 555 webui_visible_ = true; |
| 556 } | 556 } |
| 557 | 557 |
| 558 } // namespace chromeos | 558 } // namespace chromeos |
| OLD | NEW |