| OLD | NEW |
| 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/overscroll_controller.h" | 5 #include "content/browser/renderer_host/overscroll_controller.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "content/browser/renderer_host/overscroll_controller_delegate.h" | 9 #include "content/browser/renderer_host/overscroll_controller_delegate.h" |
| 10 #include "content/public/browser/overscroll_configuration.h" | 10 #include "content/public/browser/overscroll_configuration.h" |
| 11 #include "content/public/common/content_switches.h" | 11 #include "content/public/common/content_switches.h" |
| 12 | 12 |
| 13 using blink::WebInputEvent; | 13 using blink::WebInputEvent; |
| 14 | 14 |
| 15 namespace { | 15 namespace { |
| 16 | 16 |
| 17 bool IsScrollEndEffectEnabled() { | 17 bool IsScrollEndEffectEnabled() { |
| 18 return CommandLine::ForCurrentProcess()->GetSwitchValueASCII( | 18 return base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII( |
| 19 switches::kScrollEndEffect) == "1"; | 19 switches::kScrollEndEffect) == "1"; |
| 20 } | 20 } |
| 21 | 21 |
| 22 } // namespace | 22 } // namespace |
| 23 | 23 |
| 24 namespace content { | 24 namespace content { |
| 25 | 25 |
| 26 OverscrollController::OverscrollController() | 26 OverscrollController::OverscrollController() |
| 27 : overscroll_mode_(OVERSCROLL_NONE), | 27 : overscroll_mode_(OVERSCROLL_NONE), |
| 28 scroll_state_(STATE_UNKNOWN), | 28 scroll_state_(STATE_UNKNOWN), |
| (...skipping 321 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 350 overscroll_mode_ = mode; | 350 overscroll_mode_ = mode; |
| 351 if (overscroll_mode_ == OVERSCROLL_NONE) | 351 if (overscroll_mode_ == OVERSCROLL_NONE) |
| 352 overscroll_delta_x_ = overscroll_delta_y_ = 0.f; | 352 overscroll_delta_x_ = overscroll_delta_y_ = 0.f; |
| 353 else | 353 else |
| 354 scroll_state_ = STATE_OVERSCROLLING; | 354 scroll_state_ = STATE_OVERSCROLLING; |
| 355 if (delegate_) | 355 if (delegate_) |
| 356 delegate_->OnOverscrollModeChange(old_mode, overscroll_mode_); | 356 delegate_->OnOverscrollModeChange(old_mode, overscroll_mode_); |
| 357 } | 357 } |
| 358 | 358 |
| 359 } // namespace content | 359 } // namespace content |
| OLD | NEW |