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

Side by Side Diff: ui/views/view.cc

Issue 1680613002: Adding momentum/overscroll to views:: ScrollViews Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix Tableview layout. aaaand I think we are done Created 4 years, 4 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
« no previous file with comments | « ui/views/view.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 #define _USE_MATH_DEFINES // For VC++ to get M_PI. This has to be first. 5 #define _USE_MATH_DEFINES // For VC++ to get M_PI. This has to be first.
6 6
7 #include "ui/views/view.h" 7 #include "ui/views/view.h"
8 8
9 #include <algorithm> 9 #include <algorithm>
10 #include <cmath> 10 #include <cmath>
(...skipping 1337 matching lines...) Expand 10 before | Expand all | Expand 10 after
1348 void View::ScrollRectToVisible(const gfx::Rect& rect) { 1348 void View::ScrollRectToVisible(const gfx::Rect& rect) {
1349 // We must take RTL UI mirroring into account when adjusting the position of 1349 // We must take RTL UI mirroring into account when adjusting the position of
1350 // the region. 1350 // the region.
1351 if (parent_) { 1351 if (parent_) {
1352 gfx::Rect scroll_rect(rect); 1352 gfx::Rect scroll_rect(rect);
1353 scroll_rect.Offset(GetMirroredX(), y()); 1353 scroll_rect.Offset(GetMirroredX(), y());
1354 parent_->ScrollRectToVisible(scroll_rect); 1354 parent_->ScrollRectToVisible(scroll_rect);
1355 } 1355 }
1356 } 1356 }
1357 1357
1358 ScrollView* View::EnclosingScrollView() {
1359 return parent() ? parent()->EnclosingScrollView() : nullptr;
1360 }
1361
1358 int View::GetPageScrollIncrement(ScrollView* scroll_view, 1362 int View::GetPageScrollIncrement(ScrollView* scroll_view,
1359 bool is_horizontal, bool is_positive) { 1363 bool is_horizontal, bool is_positive) {
1360 return 0; 1364 return 0;
1361 } 1365 }
1362 1366
1363 int View::GetLineScrollIncrement(ScrollView* scroll_view, 1367 int View::GetLineScrollIncrement(ScrollView* scroll_view,
1364 bool is_horizontal, bool is_positive) { 1368 bool is_horizontal, bool is_positive) {
1365 return 0; 1369 return 0;
1366 } 1370 }
1367 1371
(...skipping 1052 matching lines...) Expand 10 before | Expand all | Expand 10 after
2420 // Message the RootView to do the drag and drop. That way if we're removed 2424 // Message the RootView to do the drag and drop. That way if we're removed
2421 // the RootView can detect it and avoid calling us back. 2425 // the RootView can detect it and avoid calling us back.
2422 gfx::Point widget_location(event.location()); 2426 gfx::Point widget_location(event.location());
2423 ConvertPointToWidget(this, &widget_location); 2427 ConvertPointToWidget(this, &widget_location);
2424 widget->RunShellDrag(this, data, widget_location, drag_operations, source); 2428 widget->RunShellDrag(this, data, widget_location, drag_operations, source);
2425 // WARNING: we may have been deleted. 2429 // WARNING: we may have been deleted.
2426 return true; 2430 return true;
2427 } 2431 }
2428 2432
2429 } // namespace views 2433 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/view.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698