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

Unified Diff: chrome/browser/ui/views/tabs/tab.cc

Issue 2897533003: Change default ink drop center points to center of contents bounds (Closed)
Patch Set: fix compile Created 3 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/ui/views/status_bubble_views.cc ('k') | chrome/browser/ui/views/toolbar/app_menu.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/views/tabs/tab.cc
diff --git a/chrome/browser/ui/views/tabs/tab.cc b/chrome/browser/ui/views/tabs/tab.cc
index 5ee49b0d944674594c5b9efb03e574d7356234f0..38aeef5886207f778020af0e68db30f54fcf76fd 100644
--- a/chrome/browser/ui/views/tabs/tab.cc
+++ b/chrome/browser/ui/views/tabs/tab.cc
@@ -320,8 +320,7 @@ class Tab::TabCloseButton : public views::ImageButton,
return ViewTargeterDelegate::TargetForRect(root, rect);
// Ignore the padding set on the button.
- gfx::Rect contents_bounds = GetContentsBounds();
- contents_bounds.set_x(GetMirroredXForRect(contents_bounds));
+ gfx::Rect contents_bounds = GetMirroredRect(GetContentsBounds());
#if defined(USE_AURA)
// Include the padding in hit-test for touch events.
@@ -342,9 +341,7 @@ class Tab::TabCloseButton : public views::ImageButton,
// We need to define this so hit-testing won't include the border region.
bool GetHitTestMask(gfx::Path* mask) const override {
- gfx::Rect button_bounds(GetContentsBounds());
- button_bounds.set_x(GetMirroredXForRect(button_bounds));
- mask->addRect(gfx::RectToSkRect(button_bounds));
+ mask->addRect(gfx::RectToSkRect(GetMirroredRect(GetContentsBounds())));
return true;
}
@@ -1269,8 +1266,7 @@ void Tab::PaintPinnedTabTitleChangedIndicatorAndIcon(
}
void Tab::PaintIcon(gfx::Canvas* canvas) {
- gfx::Rect bounds = favicon_bounds_;
- bounds.set_x(GetMirroredXForRect(bounds));
+ gfx::Rect bounds = GetMirroredRect(favicon_bounds_);
bounds.Offset(0, favicon_hiding_offset_);
bounds.Intersect(GetContentsBounds());
if (bounds.IsEmpty())
@@ -1446,8 +1442,7 @@ void Tab::ScheduleIconPaint() {
// Extends the area to the bottom when the crash animation is in progress.
if (crash_icon_animation_->is_animating())
bounds.set_height(height() - bounds.y());
- bounds.set_x(GetMirroredXForRect(bounds));
- SchedulePaintInRect(bounds);
+ SchedulePaintInRect(GetMirroredRect(bounds));
}
Tab::BackgroundCache::BackgroundCache() = default;
« no previous file with comments | « chrome/browser/ui/views/status_bubble_views.cc ('k') | chrome/browser/ui/views/toolbar/app_menu.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698