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

Unified Diff: content/browser/renderer_host/render_widget_host_view_aura.cc

Issue 11416292: Revert 170477 - Removes the |event| parameter from ActivationDelegate::ShouldActivate and makes the… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 1 month 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 side-by-side diff with in-line comments
Download patch
Index: content/browser/renderer_host/render_widget_host_view_aura.cc
===================================================================
--- content/browser/renderer_host/render_widget_host_view_aura.cc (revision 170548)
+++ content/browser/renderer_host/render_widget_host_view_aura.cc (working copy)
@@ -285,8 +285,7 @@
paint_canvas_(NULL),
synthetic_move_sent_(false),
accelerated_compositing_state_changed_(false),
- can_lock_compositor_(YES),
- pointer_activate_(false) {
+ can_lock_compositor_(YES) {
host_->SetView(this);
window_observer_.reset(new WindowObserver(this));
window_->AddObserver(window_observer_.get());
@@ -1542,8 +1541,6 @@
ui::EventResult RenderWidgetHostViewAura::OnMouseEvent(ui::MouseEvent* event) {
TRACE_EVENT0("browser", "RenderWidgetHostViewAura::OnMouseEvent");
- pointer_activate_ = event->type() == ui::ET_MOUSE_PRESSED;
-
if (mouse_locked_) {
// Hide the cursor if someone else has shown it.
aura::client::CursorClient* cursor_client =
@@ -1684,12 +1681,10 @@
RenderViewHostDelegate* delegate = NULL;
if (popup_type_ == WebKit::WebPopupTypeNone && !is_fullscreen_)
delegate = RenderViewHost::From(host_)->GetDelegate();
-
- bool gesture_begin = event->type() == ui::ET_GESTURE_BEGIN &&
- event->details().touch_points() == 1;
- if (delegate && gesture_begin)
+ if (delegate && event->type() == ui::ET_GESTURE_BEGIN &&
+ event->details().touch_points() == 1) {
delegate->HandleGestureBegin();
- pointer_activate_ = gesture_begin;
+ }
WebKit::WebGestureEvent gesture = MakeWebGestureEvent(event);
if (event->type() == ui::ET_GESTURE_TAP_DOWN) {
@@ -1727,19 +1722,24 @@
////////////////////////////////////////////////////////////////////////////////
// RenderWidgetHostViewAura, aura::client::ActivationDelegate implementation:
-bool RenderWidgetHostViewAura::ShouldActivate() const {
+bool RenderWidgetHostViewAura::ShouldActivate(const ui::Event* event) {
+ bool activate = false;
+ if (event) {
+ if (event->type() == ui::ET_MOUSE_PRESSED) {
+ activate = true;
+ } else if (event->type() == ui::ET_GESTURE_BEGIN) {
+ activate = static_cast<const ui::GestureEvent*>(event)->
+ details().touch_points() == 1;
+ }
+ } else {
+ return true;
+ }
+ if (activate)
+ host_->OnPointerEventActivate();
return is_fullscreen_;
}
void RenderWidgetHostViewAura::OnActivated() {
- // |pointer_activate_| will be true when we are activated as the result of
- // a valid input event.
- // TODO(sadrul): It would be nice if we could get the currently processed
- // event from the RootWindow's EventDispatcher, then we could
- // avoid this extra field and just check the type/details on
- // the current event here.
- if (pointer_activate_)
- host_->OnPointerEventActivate();
}
void RenderWidgetHostViewAura::OnLostActive() {

Powered by Google App Engine
This is Rietveld 408576698