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

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

Issue 2815823003: Notify OverscrollController of gesture events in plugins. (Closed)
Patch Set: Address comments. Created 3 years, 6 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 <set> 7 #include <set>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/auto_reset.h" 10 #include "base/auto_reset.h"
(...skipping 1099 matching lines...) Expand 10 before | Expand all | Expand 10 after
1110 // of indicating that touchpad scroll has ended, we don't actually want 1110 // of indicating that touchpad scroll has ended, we don't actually want
1111 // a fling animation. Note: Similar code exists in 1111 // a fling animation. Note: Similar code exists in
1112 // RenderWidgetHostViewChildFrame::FilterInputEvent() 1112 // RenderWidgetHostViewChildFrame::FilterInputEvent()
1113 return INPUT_EVENT_ACK_STATE_NO_CONSUMER_EXISTS; 1113 return INPUT_EVENT_ACK_STATE_NO_CONSUMER_EXISTS;
1114 } 1114 }
1115 1115
1116 return consumed ? INPUT_EVENT_ACK_STATE_CONSUMED 1116 return consumed ? INPUT_EVENT_ACK_STATE_CONSUMED
1117 : INPUT_EVENT_ACK_STATE_NOT_CONSUMED; 1117 : INPUT_EVENT_ACK_STATE_NOT_CONSUMED;
1118 } 1118 }
1119 1119
1120 InputEventAckState RenderWidgetHostViewAura::FilterChildGestureEvent(
1121 const blink::WebGestureEvent& gesture_event) {
1122 if (overscroll_controller_ &&
1123 overscroll_controller_->WillHandleEvent(gesture_event))
1124 return INPUT_EVENT_ACK_STATE_CONSUMED;
1125 return INPUT_EVENT_ACK_STATE_NOT_CONSUMED;
1126 }
1127
1120 BrowserAccessibilityManager* 1128 BrowserAccessibilityManager*
1121 RenderWidgetHostViewAura::CreateBrowserAccessibilityManager( 1129 RenderWidgetHostViewAura::CreateBrowserAccessibilityManager(
1122 BrowserAccessibilityDelegate* delegate, bool for_root_frame) { 1130 BrowserAccessibilityDelegate* delegate, bool for_root_frame) {
1123 BrowserAccessibilityManager* manager = NULL; 1131 BrowserAccessibilityManager* manager = NULL;
1124 #if defined(OS_WIN) 1132 #if defined(OS_WIN)
1125 manager = new BrowserAccessibilityManagerWin( 1133 manager = new BrowserAccessibilityManagerWin(
1126 BrowserAccessibilityManagerWin::GetEmptyDocument(), delegate); 1134 BrowserAccessibilityManagerWin::GetEmptyDocument(), delegate);
1127 #else 1135 #else
1128 manager = BrowserAccessibilityManager::Create( 1136 manager = BrowserAccessibilityManager::Create(
1129 BrowserAccessibilityManager::GetEmptyDocument(), delegate); 1137 BrowserAccessibilityManager::GetEmptyDocument(), delegate);
(...skipping 967 matching lines...) Expand 10 before | Expand all | Expand 10 after
2097 host_->SendCursorVisibilityState(is_visible); 2105 host_->SendCursorVisibilityState(is_visible);
2098 } 2106 }
2099 2107
2100 void RenderWidgetHostViewAura::SetOverscrollControllerEnabled(bool enabled) { 2108 void RenderWidgetHostViewAura::SetOverscrollControllerEnabled(bool enabled) {
2101 if (!enabled) 2109 if (!enabled)
2102 overscroll_controller_.reset(); 2110 overscroll_controller_.reset();
2103 else if (!overscroll_controller_) 2111 else if (!overscroll_controller_)
2104 overscroll_controller_.reset(new OverscrollController()); 2112 overscroll_controller_.reset(new OverscrollController());
2105 } 2113 }
2106 2114
2115 void RenderWidgetHostViewAura::SetOverscrollControllerForTesting(
2116 std::unique_ptr<OverscrollController> controller) {
2117 overscroll_controller_ = std::move(controller);
2118 }
2119
2107 void RenderWidgetHostViewAura::SnapToPhysicalPixelBoundary() { 2120 void RenderWidgetHostViewAura::SnapToPhysicalPixelBoundary() {
2108 // The top left corner of our view in window coordinates might not land on a 2121 // The top left corner of our view in window coordinates might not land on a
2109 // device pixel boundary if we have a non-integer device scale. In that case, 2122 // device pixel boundary if we have a non-integer device scale. In that case,
2110 // to avoid the web contents area looking blurry we translate the web contents 2123 // to avoid the web contents area looking blurry we translate the web contents
2111 // in the +x, +y direction to land on the nearest pixel boundary. This may 2124 // in the +x, +y direction to land on the nearest pixel boundary. This may
2112 // cause the bottom and right edges to be clipped slightly, but that's ok. 2125 // cause the bottom and right edges to be clipped slightly, but that's ok.
2113 #if defined(OS_CHROMEOS) 2126 #if defined(OS_CHROMEOS)
2114 aura::Window* snapped = window_->GetToplevelWindow(); 2127 aura::Window* snapped = window_->GetToplevelWindow();
2115 #else 2128 #else
2116 aura::Window* snapped = window_->GetRootWindow(); 2129 aura::Window* snapped = window_->GetRootWindow();
(...skipping 300 matching lines...) Expand 10 before | Expand all | Expand 10 after
2417 } 2430 }
2418 2431
2419 void RenderWidgetHostViewAura::UpdateNeedsBeginFramesInternal() { 2432 void RenderWidgetHostViewAura::UpdateNeedsBeginFramesInternal() {
2420 if (!delegated_frame_host_) 2433 if (!delegated_frame_host_)
2421 return; 2434 return;
2422 delegated_frame_host_->SetNeedsBeginFrames(needs_begin_frames_ || 2435 delegated_frame_host_->SetNeedsBeginFrames(needs_begin_frames_ ||
2423 needs_flush_input_); 2436 needs_flush_input_);
2424 } 2437 }
2425 2438
2426 } // namespace content 2439 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698