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

Side by Side Diff: content/browser/renderer_host/render_widget_host_view_aura.cc

Issue 20526005: Implement virtual keyboard hiding. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Init Created 7 years, 4 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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "content/browser/renderer_host/render_widget_host_view_aura.h" 5 #include "content/browser/renderer_host/render_widget_host_view_aura.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/bind_helpers.h" 8 #include "base/bind_helpers.h"
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/debug/trace_event.h" 10 #include "base/debug/trace_event.h"
(...skipping 2571 matching lines...) Expand 10 before | Expand all | Expand 10 after
2582 } 2582 }
2583 2583
2584 switch (event->type()) { 2584 switch (event->type()) {
2585 case ui::ET_MOUSE_PRESSED: 2585 case ui::ET_MOUSE_PRESSED:
2586 window_->SetCapture(); 2586 window_->SetCapture();
2587 // Confirm existing composition text on mouse click events, to make sure 2587 // Confirm existing composition text on mouse click events, to make sure
2588 // the input caret won't be moved with an ongoing composition text. 2588 // the input caret won't be moved with an ongoing composition text.
2589 FinishImeCompositionSession(); 2589 FinishImeCompositionSession();
2590 break; 2590 break;
2591 case ui::ET_MOUSE_RELEASED: 2591 case ui::ET_MOUSE_RELEASED:
2592 // The input method needs to know if an already-focused text field was
2593 // clicked again (refocused).
2594 GetInputMethod()->OnPossibleRefocus();
2595
SteveT 2013/07/31 03:19:18 Handling "refocus" here and below.
Seigo Nonaka 2013/08/07 08:41:18 Hmm, this might work for many cases but I think th
SteveT 2013/08/07 12:26:39 Just Omnibox, or every other native textbox, like
2592 window_->ReleaseCapture(); 2596 window_->ReleaseCapture();
2593 break; 2597 break;
2594 default: 2598 default:
2595 break; 2599 break;
2596 } 2600 }
2597 2601
2598 // Needed to propagate mouse event to native_tab_contents_view_aura. 2602 // Needed to propagate mouse event to native_tab_contents_view_aura.
2599 // TODO(pkotwicz): Find a better way of doing this. 2603 // TODO(pkotwicz): Find a better way of doing this.
2600 // In fullscreen mode which is typically used by flash, don't forward 2604 // In fullscreen mode which is typically used by flash, don't forward
2601 // the mouse events to the parent. The renderer and the plugin process 2605 // the mouse events to the parent. The renderer and the plugin process
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
2633 } 2637 }
2634 2638
2635 event->SetHandled(); 2639 event->SetHandled();
2636 } 2640 }
2637 2641
2638 void RenderWidgetHostViewAura::OnTouchEvent(ui::TouchEvent* event) { 2642 void RenderWidgetHostViewAura::OnTouchEvent(ui::TouchEvent* event) {
2639 TRACE_EVENT0("input", "RenderWidgetHostViewAura::OnTouchEvent"); 2643 TRACE_EVENT0("input", "RenderWidgetHostViewAura::OnTouchEvent");
2640 if (touch_editing_client_ && touch_editing_client_->HandleInputEvent(event)) 2644 if (touch_editing_client_ && touch_editing_client_->HandleInputEvent(event))
2641 return; 2645 return;
2642 2646
2647 if (event->type() == ui::ET_TOUCH_RELEASED)
2648 GetInputMethod()->OnPossibleRefocus();
2649
2643 // Update the touch event first. 2650 // Update the touch event first.
2644 WebKit::WebTouchPoint* point = UpdateWebTouchEventFromUIEvent(*event, 2651 WebKit::WebTouchPoint* point = UpdateWebTouchEventFromUIEvent(*event,
2645 &touch_event_); 2652 &touch_event_);
2646 2653
2647 // Forward the touch event only if a touch point was updated, and there's a 2654 // Forward the touch event only if a touch point was updated, and there's a
2648 // touch-event handler in the page, and no other touch-event is in the queue. 2655 // touch-event handler in the page, and no other touch-event is in the queue.
2649 // It is important to always consume the event if there is a touch-event 2656 // It is important to always consume the event if there is a touch-event
2650 // handler in the page, or some touch-event is already in the queue, even if 2657 // handler in the page, or some touch-event is already in the queue, even if
2651 // no point has been updated, to make sure that this event does not get 2658 // no point has been updated, to make sure that this event does not get
2652 // processed by the gesture recognizer before the events in the queue. 2659 // processed by the gesture recognizer before the events in the queue.
(...skipping 515 matching lines...) Expand 10 before | Expand all | Expand 10 after
3168 RenderWidgetHost* widget) { 3175 RenderWidgetHost* widget) {
3169 return new RenderWidgetHostViewAura(widget); 3176 return new RenderWidgetHostViewAura(widget);
3170 } 3177 }
3171 3178
3172 // static 3179 // static
3173 void RenderWidgetHostViewPort::GetDefaultScreenInfo(WebScreenInfo* results) { 3180 void RenderWidgetHostViewPort::GetDefaultScreenInfo(WebScreenInfo* results) {
3174 GetScreenInfoForWindow(results, NULL); 3181 GetScreenInfoForWindow(results, NULL);
3175 } 3182 }
3176 3183
3177 } // namespace content 3184 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698