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

Unified Diff: chrome/browser/ui/views/notifications/balloon_view_views.cc

Issue 11110004: Make gfx::Rect class operations consistently mutate the class they are called on. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: cc/ fixes Created 8 years, 2 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/extensions/extension_dialog.cc ('k') | chrome/browser/ui/views/toolbar_view.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/views/notifications/balloon_view_views.cc
diff --git a/chrome/browser/ui/views/notifications/balloon_view_views.cc b/chrome/browser/ui/views/notifications/balloon_view_views.cc
index a9d7c668f4b54f4a40230827ba436f8f9e51f0a2..797514394ca5d6d372b003e9d657a92b4b51f813 100644
--- a/chrome/browser/ui/views/notifications/balloon_view_views.cc
+++ b/chrome/browser/ui/views/notifications/balloon_view_views.cc
@@ -260,7 +260,8 @@ gfx::Rect BalloonViewImpl::GetCloseButtonBounds() const {
const gfx::Size& pref_size(close_button_->GetPreferredSize());
bounds.Inset(bounds.width() - kShelfMargin - pref_size.width(), 0,
kShelfMargin, 0);
- return bounds.Center(pref_size);
+ bounds.ClampToCenteredSize(pref_size);
+ return bounds;
}
gfx::Rect BalloonViewImpl::GetOptionsButtonBounds() const {
@@ -270,7 +271,8 @@ gfx::Rect BalloonViewImpl::GetOptionsButtonBounds() const {
bounds.set_x(GetCloseButtonBounds().x() - kOptionsDismissSpacing -
pref_size.width());
bounds.set_width(pref_size.width());
- return bounds.Center(pref_size);
+ bounds.ClampToCenteredSize(pref_size);
+ return bounds;
}
gfx::Rect BalloonViewImpl::GetLabelBounds() const {
@@ -280,7 +282,8 @@ gfx::Rect BalloonViewImpl::GetLabelBounds() const {
bounds.Inset(kLabelLeftMargin, 0, bounds.width() -
GetOptionsButtonBounds().x() + kLabelOptionsSpacing, 0);
pref_size.set_width(bounds.width());
- return bounds.Center(pref_size);
+ bounds.ClampToCenteredSize(pref_size);
+ return bounds;
}
void BalloonViewImpl::Show(Balloon* balloon) {
« no previous file with comments | « chrome/browser/ui/views/extensions/extension_dialog.cc ('k') | chrome/browser/ui/views/toolbar_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698