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_impl.cc

Issue 10917102: Context menus should appear above the touch point if invoked by long press. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: patch Created 8 years, 3 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 | Annotate | Revision Log
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_impl.h" 5 #include "content/browser/renderer_host/render_widget_host_impl.h"
6 6
7 #include <math.h> 7 #include <math.h>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/auto_reset.h" 10 #include "base/auto_reset.h"
(...skipping 993 matching lines...) Expand 10 before | Expand all | Expand 10 after
1004 ForwardInputEvent(key_event, sizeof(WebKeyboardEvent), 1004 ForwardInputEvent(key_event, sizeof(WebKeyboardEvent),
1005 is_keyboard_shortcut); 1005 is_keyboard_shortcut);
1006 } 1006 }
1007 } 1007 }
1008 1008
1009 void RenderWidgetHostImpl::ForwardInputEvent(const WebInputEvent& input_event, 1009 void RenderWidgetHostImpl::ForwardInputEvent(const WebInputEvent& input_event,
1010 int event_size, 1010 int event_size,
1011 bool is_keyboard_shortcut) { 1011 bool is_keyboard_shortcut) {
1012 TRACE_EVENT0("renderer_host", "RenderWidgetHostImpl::ForwardInputEvent"); 1012 TRACE_EVENT0("renderer_host", "RenderWidgetHostImpl::ForwardInputEvent");
1013 1013
1014 in_process_event_types_.push(input_event.type);
1015
1014 if (!process_->HasConnection()) 1016 if (!process_->HasConnection())
1015 return; 1017 return;
1016 1018
1017 DCHECK(!process_->IgnoreInputEvents()); 1019 DCHECK(!process_->IgnoreInputEvents());
1018 1020
1019 IPC::Message* message = new ViewMsg_HandleInputEvent(routing_id_); 1021 IPC::Message* message = new ViewMsg_HandleInputEvent(routing_id_);
1020 message->WriteData( 1022 message->WriteData(
1021 reinterpret_cast<const char*>(&input_event), event_size); 1023 reinterpret_cast<const char*>(&input_event), event_size);
1022 // |is_keyboard_shortcut| only makes sense for RawKeyDown events. 1024 // |is_keyboard_shortcut| only makes sense for RawKeyDown events.
1023 if (input_event.type == WebInputEvent::RawKeyDown) 1025 if (input_event.type == WebInputEvent::RawKeyDown)
(...skipping 503 matching lines...) Expand 10 before | Expand all | Expand 10 after
1527 // On other platforms, this will be equivalent to MPArch.RWH_OnMsgUpdateRect. 1529 // On other platforms, this will be equivalent to MPArch.RWH_OnMsgUpdateRect.
1528 delta = now - paint_start; 1530 delta = now - paint_start;
1529 UMA_HISTOGRAM_TIMES("MPArch.RWH_TotalPaintTime", delta); 1531 UMA_HISTOGRAM_TIMES("MPArch.RWH_TotalPaintTime", delta);
1530 UNSHIPPED_TRACE_EVENT_INSTANT1("test_latency", "UpdateRectComplete", 1532 UNSHIPPED_TRACE_EVENT_INSTANT1("test_latency", "UpdateRectComplete",
1531 "x+y", params.bitmap_rect.x() + params.bitmap_rect.y()); 1533 "x+y", params.bitmap_rect.x() + params.bitmap_rect.y());
1532 } 1534 }
1533 1535
1534 void RenderWidgetHostImpl::OnMsgInputEventAck(WebInputEvent::Type event_type, 1536 void RenderWidgetHostImpl::OnMsgInputEventAck(WebInputEvent::Type event_type,
1535 bool processed) { 1537 bool processed) {
1536 TRACE_EVENT0("renderer_host", "RenderWidgetHostImpl::OnMsgInputEventAck"); 1538 TRACE_EVENT0("renderer_host", "RenderWidgetHostImpl::OnMsgInputEventAck");
1539 DCHECK(!in_process_event_types_.empty() &&
1540 in_process_event_types_.front() == event_type);
1541 in_process_event_types_.pop();
1537 1542
1538 // Log the time delta for processing an input event. 1543 // Log the time delta for processing an input event.
1539 TimeDelta delta = TimeTicks::Now() - input_event_start_time_; 1544 TimeDelta delta = TimeTicks::Now() - input_event_start_time_;
1540 UMA_HISTOGRAM_TIMES("MPArch.RWH_InputEventDelta", delta); 1545 UMA_HISTOGRAM_TIMES("MPArch.RWH_InputEventDelta", delta);
1541 1546
1542 // Cancel pending hung renderer checks since the renderer is responsive. 1547 // Cancel pending hung renderer checks since the renderer is responsive.
1543 if (decrement_in_flight_event_count() == 0) 1548 if (decrement_in_flight_event_count() == 0)
1544 StopHangMonitorTimeout(); 1549 StopHangMonitorTimeout();
1545 1550
1546 int type = static_cast<int>(event_type); 1551 int type = static_cast<int>(event_type);
(...skipping 495 matching lines...) Expand 10 before | Expand all | Expand 10 after
2042 // indicate that no callback is in progress (i.e. without this line 2047 // indicate that no callback is in progress (i.e. without this line
2043 // DelayedAutoResized will not get called again). 2048 // DelayedAutoResized will not get called again).
2044 new_auto_size_.SetSize(0, 0); 2049 new_auto_size_.SetSize(0, 0);
2045 if (!should_auto_resize_) 2050 if (!should_auto_resize_)
2046 return; 2051 return;
2047 2052
2048 OnRenderAutoResized(new_size); 2053 OnRenderAutoResized(new_size);
2049 } 2054 }
2050 2055
2051 } // namespace content 2056 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698