Misc. cleanup found while prototyping variable tab slopes:

Desktop / Chromium - Peter Kasting [chromium.org] - 19 May 2017 15:54 EDT

- Convert overlap constant to be computed based on the endcap width
- Add a constant for the minimum endcap width
- Move leading_width_for_drag() into the drag controller (the only user)
- Remove "unscaled" terminology, which is just confusing
- Pass endcap width into GetFillPath() and GetBorderPath() so they don't depend on any external functions (will make it easier to pass varying
values in later)
- Definition order should match declaration order
- x + width -> right
- Factor repeated expressions into temps
- Unittest should check that pinned tabs don't have visible titles
- Bugfix: Unittest should check title visibility, not width. This would lead to testing the title coordinates (incorrectly) for pinned tabs, but happened to pass given how the test is structured.
- Use ranges for more readable loops

Bug: None

Change-Id: I1cf6ca054d7a051691d59a50005db305ab910301 Reviewed-on: https://chromium-review.googlesource.com/505639 Commit-Queue: Peter Kasting

22f7951 Misc. cleanup found while prototyping variable tab slopes:
chrome/browser/ui/views/tabs/tab.cc | 124 ++++++++++++---------
chrome/browser/ui/views/tabs/tab.h | 18 +--
.../browser/ui/views/tabs/tab_drag_controller.cc | 21 +++-
chrome/browser/ui/views/tabs/tab_strip.cc | 39 ++++---
chrome/browser/ui/views/tabs/tab_strip_layout.cc | 8 +-
chrome/browser/ui/views/tabs/tab_unittest.cc | 31 +++---
6 files changed, 134 insertions(+), 107 deletions(-)

Upstream: git.chromium.org


  • Share