Chromium Code Reviews| 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 #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 1345 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1356 int View::GetPageScrollIncrement(ScrollView* scroll_view, | 1356 int View::GetPageScrollIncrement(ScrollView* scroll_view, |
| 1357 bool is_horizontal, bool is_positive) { | 1357 bool is_horizontal, bool is_positive) { |
| 1358 return 0; | 1358 return 0; |
| 1359 } | 1359 } |
| 1360 | 1360 |
| 1361 int View::GetLineScrollIncrement(ScrollView* scroll_view, | 1361 int View::GetLineScrollIncrement(ScrollView* scroll_view, |
| 1362 bool is_horizontal, bool is_positive) { | 1362 bool is_horizontal, bool is_positive) { |
| 1363 return 0; | 1363 return 0; |
| 1364 } | 1364 } |
| 1365 | 1365 |
| 1366 // Accelerators ---------------------------------------------------------------- | |
| 1367 | |
| 1368 bool View::HandlesAccelerator(const ui::Accelerator& accelerator) { | |
| 1369 return accelerators_ && | |
|
msw
2016/03/03 23:01:40
nit: should this check CanHandleAccelerators() too
Evan Stade
2016/03/07 18:36:38
hm, maybe. Done.
| |
| 1370 std::find(accelerators_->begin(), accelerators_->end(), accelerator) != | |
| 1371 accelerators_->end(); | |
| 1372 } | |
| 1373 | |
| 1366 //////////////////////////////////////////////////////////////////////////////// | 1374 //////////////////////////////////////////////////////////////////////////////// |
| 1367 // View, protected: | 1375 // View, protected: |
| 1368 | 1376 |
| 1369 // Size and disposition -------------------------------------------------------- | 1377 // Size and disposition -------------------------------------------------------- |
| 1370 | 1378 |
| 1371 void View::OnBoundsChanged(const gfx::Rect& previous_bounds) { | 1379 void View::OnBoundsChanged(const gfx::Rect& previous_bounds) { |
| 1372 } | 1380 } |
| 1373 | 1381 |
| 1374 void View::PreferredSizeChanged() { | 1382 void View::PreferredSizeChanged() { |
| 1375 InvalidateLayout(); | 1383 InvalidateLayout(); |
| (...skipping 1050 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2426 // Message the RootView to do the drag and drop. That way if we're removed | 2434 // Message the RootView to do the drag and drop. That way if we're removed |
| 2427 // the RootView can detect it and avoid calling us back. | 2435 // the RootView can detect it and avoid calling us back. |
| 2428 gfx::Point widget_location(event.location()); | 2436 gfx::Point widget_location(event.location()); |
| 2429 ConvertPointToWidget(this, &widget_location); | 2437 ConvertPointToWidget(this, &widget_location); |
| 2430 widget->RunShellDrag(this, data, widget_location, drag_operations, source); | 2438 widget->RunShellDrag(this, data, widget_location, drag_operations, source); |
| 2431 // WARNING: we may have been deleted. | 2439 // WARNING: we may have been deleted. |
| 2432 return true; | 2440 return true; |
| 2433 } | 2441 } |
| 2434 | 2442 |
| 2435 } // namespace views | 2443 } // namespace views |
| OLD | NEW |