Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(158)

Side by Side Diff: chrome/browser/chromeos/login/ui/webui_login_view.cc

Issue 2573073003: Collapse the API surface on WebInputEvent via accessor functions. (Closed)
Patch Set: Fix nits Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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/common/focus_cycler.h" 7 #include "ash/common/focus_cycler.h"
8 #include "ash/common/system/status_area_widget_delegate.h" 8 #include "ash/common/system/status_area_widget_delegate.h"
9 #include "ash/common/system/tray/system_tray.h" 9 #include "ash/common/system/tray/system_tray.h"
10 #include "ash/common/wm_shell.h" 10 #include "ash/common/wm_shell.h"
(...skipping 511 matching lines...) Expand 10 before | Expand all | Expand 10 after
522 // accelerator when this view has focus. 522 // accelerator when this view has focus.
523 ScopedArrowKeyTraversal arrow_key_traversal(false); 523 ScopedArrowKeyTraversal arrow_key_traversal(false);
524 524
525 unhandled_keyboard_event_handler_.HandleKeyboardEvent(event, 525 unhandled_keyboard_event_handler_.HandleKeyboardEvent(event,
526 GetFocusManager()); 526 GetFocusManager());
527 } 527 }
528 528
529 // Make sure error bubble is cleared on keyboard event. This is needed 529 // Make sure error bubble is cleared on keyboard event. This is needed
530 // when the focus is inside an iframe. Only clear on KeyDown to prevent hiding 530 // when the focus is inside an iframe. Only clear on KeyDown to prevent hiding
531 // an immediate authentication error (See crbug.com/103643). 531 // an immediate authentication error (See crbug.com/103643).
532 if (event.type == blink::WebInputEvent::KeyDown) { 532 if (event.type() == blink::WebInputEvent::KeyDown) {
533 content::WebUI* web_ui = GetWebUI(); 533 content::WebUI* web_ui = GetWebUI();
534 if (web_ui) 534 if (web_ui)
535 web_ui->CallJavascriptFunctionUnsafe("cr.ui.Oobe.clearErrors"); 535 web_ui->CallJavascriptFunctionUnsafe("cr.ui.Oobe.clearErrors");
536 } 536 }
537 } 537 }
538 538
539 bool WebUILoginView::IsPopupOrPanel(const WebContents* source) const { 539 bool WebUILoginView::IsPopupOrPanel(const WebContents* source) const {
540 return true; 540 return true;
541 } 541 }
542 542
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
614 const GURL& security_origin, 614 const GURL& security_origin,
615 content::MediaStreamType type) { 615 content::MediaStreamType type) {
616 return MediaCaptureDevicesDispatcher::GetInstance() 616 return MediaCaptureDevicesDispatcher::GetInstance()
617 ->CheckMediaAccessPermission(web_contents, security_origin, type); 617 ->CheckMediaAccessPermission(web_contents, security_origin, type);
618 } 618 }
619 619
620 bool WebUILoginView::PreHandleGestureEvent( 620 bool WebUILoginView::PreHandleGestureEvent(
621 content::WebContents* source, 621 content::WebContents* source,
622 const blink::WebGestureEvent& event) { 622 const blink::WebGestureEvent& event) {
623 // Disable pinch zooming. 623 // Disable pinch zooming.
624 return event.type == blink::WebGestureEvent::GesturePinchBegin || 624 return event.type() == blink::WebGestureEvent::GesturePinchBegin ||
625 event.type == blink::WebGestureEvent::GesturePinchUpdate || 625 event.type() == blink::WebGestureEvent::GesturePinchUpdate ||
626 event.type == blink::WebGestureEvent::GesturePinchEnd; 626 event.type() == blink::WebGestureEvent::GesturePinchEnd;
627 } 627 }
628 628
629 void WebUILoginView::OnLoginPromptVisible() { 629 void WebUILoginView::OnLoginPromptVisible() {
630 // If we're hidden than will generate this signal once we're shown. 630 // If we're hidden than will generate this signal once we're shown.
631 if (is_hidden_ || webui_visible_) { 631 if (is_hidden_ || webui_visible_) {
632 VLOG(1) << "Login WebUI >> not emitting signal, hidden: " << is_hidden_; 632 VLOG(1) << "Login WebUI >> not emitting signal, hidden: " << is_hidden_;
633 return; 633 return;
634 } 634 }
635 TRACE_EVENT0("chromeos", "WebUILoginView::OnLoginPromptVisible"); 635 TRACE_EVENT0("chromeos", "WebUILoginView::OnLoginPromptVisible");
636 if (should_emit_login_prompt_visible_) { 636 if (should_emit_login_prompt_visible_) {
637 VLOG(1) << "Login WebUI >> login-prompt-visible"; 637 VLOG(1) << "Login WebUI >> login-prompt-visible";
638 chromeos::DBusThreadManager::Get()->GetSessionManagerClient()-> 638 chromeos::DBusThreadManager::Get()->GetSessionManagerClient()->
639 EmitLoginPromptVisible(); 639 EmitLoginPromptVisible();
640 } 640 }
641 641
642 webui_visible_ = true; 642 webui_visible_ = true;
643 } 643 }
644 644
645 } // namespace chromeos 645 } // namespace chromeos
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/input_method/textinput_test_helper.cc ('k') | chrome/browser/devtools/devtools_window.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698