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

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

Issue 63253002: Rename WebKit namespace to blink (part 3) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 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/overscroll_controller.cc
diff --git a/content/browser/renderer_host/overscroll_controller.cc b/content/browser/renderer_host/overscroll_controller.cc
index 052eedbbc50dd88364afc0199a57ce47c5d8f621..4c33aa8c20e42b1dc0d31fffe837080f2814727c 100644
--- a/content/browser/renderer_host/overscroll_controller.cc
+++ b/content/browser/renderer_host/overscroll_controller.cc
@@ -10,7 +10,7 @@
#include "content/public/browser/overscroll_configuration.h"
#include "content/public/common/content_switches.h"
-using WebKit::WebInputEvent;
+using blink::WebInputEvent;
namespace {
@@ -35,29 +35,29 @@ OverscrollController::~OverscrollController() {
}
OverscrollController::Disposition OverscrollController::DispatchEvent(
- const WebKit::WebInputEvent& event,
+ const blink::WebInputEvent& event,
const ui::LatencyInfo& latency_info) {
if (scroll_state_ != STATE_UNKNOWN) {
switch (event.type) {
- case WebKit::WebInputEvent::GestureScrollEnd:
- case WebKit::WebInputEvent::GestureFlingStart:
+ case blink::WebInputEvent::GestureScrollEnd:
+ case blink::WebInputEvent::GestureFlingStart:
scroll_state_ = STATE_UNKNOWN;
break;
- case WebKit::WebInputEvent::MouseWheel: {
- const WebKit::WebMouseWheelEvent& wheel =
- static_cast<const WebKit::WebMouseWheelEvent&>(event);
+ case blink::WebInputEvent::MouseWheel: {
+ const blink::WebMouseWheelEvent& wheel =
+ static_cast<const blink::WebMouseWheelEvent&>(event);
if (!wheel.hasPreciseScrollingDeltas ||
- wheel.phase == WebKit::WebMouseWheelEvent::PhaseEnded ||
- wheel.phase == WebKit::WebMouseWheelEvent::PhaseCancelled) {
+ wheel.phase == blink::WebMouseWheelEvent::PhaseEnded ||
+ wheel.phase == blink::WebMouseWheelEvent::PhaseCancelled) {
scroll_state_ = STATE_UNKNOWN;
}
break;
}
default:
- if (WebKit::WebInputEvent::isMouseEventType(event.type) ||
- WebKit::WebInputEvent::isKeyboardEventType(event.type)) {
+ if (blink::WebInputEvent::isMouseEventType(event.type) ||
+ blink::WebInputEvent::isKeyboardEventType(event.type)) {
scroll_state_ = STATE_UNKNOWN;
}
break;
@@ -72,7 +72,7 @@ OverscrollController::Disposition OverscrollController::DispatchEvent(
// touch-scrolls maintain state in the renderer side (in the compositor, for
// example), and the event that completes this action needs to be sent to
// the renderer so that those states can be updated/reset appropriately.
- if (WebKit::WebInputEvent::isGestureEventType(event.type)) {
+ if (blink::WebInputEvent::isGestureEventType(event.type)) {
// A gesture-event isn't sent to the GestureEventFilter when overscroll is
// in progress. So dispatch the event through the RenderWidgetHost so that
// it can reach the GestureEventFilter.
@@ -84,7 +84,7 @@ OverscrollController::Disposition OverscrollController::DispatchEvent(
if (overscroll_mode_ != OVERSCROLL_NONE && DispatchEventResetsState(event)) {
SetOverscrollMode(OVERSCROLL_NONE);
- if (WebKit::WebInputEvent::isGestureEventType(event.type)) {
+ if (blink::WebInputEvent::isGestureEventType(event.type)) {
// A gesture-event isn't sent to the GestureEventFilter when overscroll is
// in progress. So dispatch the event through the RenderWidgetHost so that
// it can reach the GestureEventFilter.
@@ -104,15 +104,15 @@ OverscrollController::Disposition OverscrollController::DispatchEvent(
return SHOULD_FORWARD_TO_RENDERER;
}
-void OverscrollController::ReceivedEventACK(const WebKit::WebInputEvent& event,
+void OverscrollController::ReceivedEventACK(const blink::WebInputEvent& event,
bool processed) {
if (processed) {
// If a scroll event is consumed by the page, i.e. some content on the page
// has been scrolled, then there is not going to be an overscroll gesture,
// until the current scroll ends, and a new scroll gesture starts.
if (scroll_state_ == STATE_UNKNOWN &&
- (event.type == WebKit::WebInputEvent::MouseWheel ||
- event.type == WebKit::WebInputEvent::GestureScrollUpdate)) {
+ (event.type == blink::WebInputEvent::MouseWheel ||
+ event.type == blink::WebInputEvent::GestureScrollUpdate)) {
scroll_state_ = STATE_CONTENT_SCROLLING;
}
return;
@@ -121,10 +121,10 @@ void OverscrollController::ReceivedEventACK(const WebKit::WebInputEvent& event,
}
void OverscrollController::DiscardingGestureEvent(
- const WebKit::WebGestureEvent& gesture) {
+ const blink::WebGestureEvent& gesture) {
if (scroll_state_ != STATE_UNKNOWN &&
- (gesture.type == WebKit::WebInputEvent::GestureScrollEnd ||
- gesture.type == WebKit::WebInputEvent::GestureFlingStart)) {
+ (gesture.type == blink::WebInputEvent::GestureScrollEnd ||
+ gesture.type == blink::WebInputEvent::GestureFlingStart)) {
scroll_state_ = STATE_UNKNOWN;
}
}
@@ -142,15 +142,15 @@ void OverscrollController::Cancel() {
}
bool OverscrollController::DispatchEventCompletesAction (
- const WebKit::WebInputEvent& event) const {
+ const blink::WebInputEvent& event) const {
if (overscroll_mode_ == OVERSCROLL_NONE)
return false;
// Complete the overscroll gesture if there was a mouse move or a scroll-end
// after the threshold.
- if (event.type != WebKit::WebInputEvent::MouseMove &&
- event.type != WebKit::WebInputEvent::GestureScrollEnd &&
- event.type != WebKit::WebInputEvent::GestureFlingStart)
+ if (event.type != blink::WebInputEvent::MouseMove &&
+ event.type != blink::WebInputEvent::GestureScrollEnd &&
+ event.type != blink::WebInputEvent::GestureFlingStart)
return false;
if (!delegate_)
@@ -160,10 +160,10 @@ bool OverscrollController::DispatchEventCompletesAction (
if (bounds.IsEmpty())
return false;
- if (event.type == WebKit::WebInputEvent::GestureFlingStart) {
+ if (event.type == blink::WebInputEvent::GestureFlingStart) {
// Check to see if the fling is in the same direction of the overscroll.
- const WebKit::WebGestureEvent gesture =
- static_cast<const WebKit::WebGestureEvent&>(event);
+ const blink::WebGestureEvent gesture =
+ static_cast<const blink::WebGestureEvent&>(event);
switch (overscroll_mode_) {
case OVERSCROLL_EAST:
if (gesture.data.flingStart.velocityX < 0)
@@ -201,34 +201,34 @@ bool OverscrollController::DispatchEventCompletesAction (
}
bool OverscrollController::DispatchEventResetsState(
- const WebKit::WebInputEvent& event) const {
+ const blink::WebInputEvent& event) const {
switch (event.type) {
- case WebKit::WebInputEvent::MouseWheel: {
+ case blink::WebInputEvent::MouseWheel: {
// Only wheel events with precise deltas (i.e. from trackpad) contribute
// to the overscroll gesture.
- const WebKit::WebMouseWheelEvent& wheel =
- static_cast<const WebKit::WebMouseWheelEvent&>(event);
+ const blink::WebMouseWheelEvent& wheel =
+ static_cast<const blink::WebMouseWheelEvent&>(event);
return !wheel.hasPreciseScrollingDeltas;
}
- case WebKit::WebInputEvent::GestureScrollUpdate:
- case WebKit::WebInputEvent::GestureFlingCancel:
+ case blink::WebInputEvent::GestureScrollUpdate:
+ case blink::WebInputEvent::GestureFlingCancel:
return false;
default:
// Touch events can arrive during an overscroll gesture initiated by
// touch-scrolling. These events should not reset the overscroll state.
- return !WebKit::WebInputEvent::isTouchEventType(event.type);
+ return !blink::WebInputEvent::isTouchEventType(event.type);
}
}
bool OverscrollController::ProcessEventForOverscroll(
- const WebKit::WebInputEvent& event) {
+ const blink::WebInputEvent& event) {
bool event_processed = false;
switch (event.type) {
- case WebKit::WebInputEvent::MouseWheel: {
- const WebKit::WebMouseWheelEvent& wheel =
- static_cast<const WebKit::WebMouseWheelEvent&>(event);
+ case blink::WebInputEvent::MouseWheel: {
+ const blink::WebMouseWheelEvent& wheel =
+ static_cast<const blink::WebMouseWheelEvent&>(event);
if (!wheel.hasPreciseScrollingDeltas)
break;
@@ -238,19 +238,19 @@ bool OverscrollController::ProcessEventForOverscroll(
event_processed = true;
break;
}
- case WebKit::WebInputEvent::GestureScrollUpdate: {
- const WebKit::WebGestureEvent& gesture =
- static_cast<const WebKit::WebGestureEvent&>(event);
+ case blink::WebInputEvent::GestureScrollUpdate: {
+ const blink::WebGestureEvent& gesture =
+ static_cast<const blink::WebGestureEvent&>(event);
ProcessOverscroll(gesture.data.scrollUpdate.deltaX,
gesture.data.scrollUpdate.deltaY,
gesture.type);
event_processed = true;
break;
}
- case WebKit::WebInputEvent::GestureFlingStart: {
+ case blink::WebInputEvent::GestureFlingStart: {
const float kFlingVelocityThreshold = 1100.f;
- const WebKit::WebGestureEvent& gesture =
- static_cast<const WebKit::WebGestureEvent&>(event);
+ const blink::WebGestureEvent& gesture =
+ static_cast<const blink::WebGestureEvent&>(event);
float velocity_x = gesture.data.flingStart.velocityX;
float velocity_y = gesture.data.flingStart.velocityY;
if (fabs(velocity_x) > kFlingVelocityThreshold) {
@@ -275,8 +275,8 @@ bool OverscrollController::ProcessEventForOverscroll(
}
default:
- DCHECK(WebKit::WebInputEvent::isGestureEventType(event.type) ||
- WebKit::WebInputEvent::isTouchEventType(event.type))
+ DCHECK(blink::WebInputEvent::isGestureEventType(event.type) ||
+ blink::WebInputEvent::isTouchEventType(event.type))
<< "Received unexpected event: " << event.type;
}
return event_processed;
@@ -284,7 +284,7 @@ bool OverscrollController::ProcessEventForOverscroll(
void OverscrollController::ProcessOverscroll(float delta_x,
float delta_y,
- WebKit::WebInputEvent::Type type) {
+ blink::WebInputEvent::Type type) {
if (scroll_state_ != STATE_CONTENT_SCROLLING)
overscroll_delta_x_ += delta_x;
overscroll_delta_y_ += delta_y;

Powered by Google App Engine
This is Rietveld 408576698