| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/web_contents/aura/overscroll_window_delegate.h" | 5 #include "content/browser/web_contents/aura/overscroll_window_delegate.h" |
| 6 | 6 |
| 7 #include "base/macros.h" | 7 #include "base/macros.h" |
| 8 #include "content/browser/renderer_host/overscroll_controller_delegate.h" | 8 #include "content/browser/renderer_host/overscroll_controller_delegate.h" |
| 9 #include "content/public/browser/overscroll_configuration.h" | 9 #include "content/public/browser/overscroll_configuration.h" |
| 10 #include "testing/gtest/include/gtest/gtest.h" | 10 #include "testing/gtest/include/gtest/gtest.h" |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 83 | 83 |
| 84 bool OnOverscrollUpdate(float delta_x, float delta_y) override { | 84 bool OnOverscrollUpdate(float delta_x, float delta_y) override { |
| 85 return true; | 85 return true; |
| 86 } | 86 } |
| 87 | 87 |
| 88 void OnOverscrollComplete(OverscrollMode overscroll_mode) override { | 88 void OnOverscrollComplete(OverscrollMode overscroll_mode) override { |
| 89 overscroll_complete_ = true; | 89 overscroll_complete_ = true; |
| 90 } | 90 } |
| 91 | 91 |
| 92 void OnOverscrollModeChange(OverscrollMode old_mode, | 92 void OnOverscrollModeChange(OverscrollMode old_mode, |
| 93 OverscrollMode new_mode) override { | 93 OverscrollMode new_mode, |
| 94 OverscrollSource source) override { |
| 94 mode_changed_ = true; | 95 mode_changed_ = true; |
| 95 current_mode_ = new_mode; | 96 current_mode_ = new_mode; |
| 96 if (current_mode_ != OVERSCROLL_NONE) | 97 if (current_mode_ != OVERSCROLL_NONE) |
| 97 overscroll_started_ = true; | 98 overscroll_started_ = true; |
| 98 } | 99 } |
| 99 | 100 |
| 100 // Window in which the overscroll window delegate is installed. | 101 // Window in which the overscroll window delegate is installed. |
| 101 std::unique_ptr<aura::Window> window_; | 102 std::unique_ptr<aura::Window> window_; |
| 102 | 103 |
| 103 // State flags. | 104 // State flags. |
| (...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 243 EXPECT_EQ(current_mode(), OVERSCROLL_NONE); | 244 EXPECT_EQ(current_mode(), OVERSCROLL_NONE); |
| 244 EXPECT_FALSE(overscroll_complete()); | 245 EXPECT_FALSE(overscroll_complete()); |
| 245 | 246 |
| 246 // We should be able to restart the overscroll without lifting the finger. | 247 // We should be able to restart the overscroll without lifting the finger. |
| 247 generator.MoveTouch(gfx::Point(touch_x + touch_start_threshold() + 1, 0)); | 248 generator.MoveTouch(gfx::Point(touch_x + touch_start_threshold() + 1, 0)); |
| 248 EXPECT_EQ(current_mode(), OVERSCROLL_EAST); | 249 EXPECT_EQ(current_mode(), OVERSCROLL_EAST); |
| 249 EXPECT_FALSE(overscroll_complete()); | 250 EXPECT_FALSE(overscroll_complete()); |
| 250 } | 251 } |
| 251 | 252 |
| 252 } // namespace content | 253 } // namespace content |
| OLD | NEW |