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

Unified Diff: chrome/browser/views/frame/browser_view.cc

Issue 18253: Fix status bubble positioning with custom border widths by positioning the bu... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 11 years, 11 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/views/frame/browser_view.cc
===================================================================
--- chrome/browser/views/frame/browser_view.cc (revision 7976)
+++ chrome/browser/views/frame/browser_view.cc (working copy)
@@ -61,10 +61,10 @@
static const int kTabShadowSize = 2;
// The height of the status bubble.
static const int kStatusBubbleHeight = 20;
-// The distance of the status bubble from the left edge of the window.
-static const int kStatusBubbleHorizontalOffset = 3;
-// The distance of the status bubble from the bottom edge of the window.
-static const int kStatusBubbleVerticalOffset = 2;
+// The overlap of the status bubble with the left edge of the window.
+static const int kStatusBubbleHorizontalOverlap = 2;
+// The overlap of the status bubble with the bottom edge of the window.
+static const int kStatusBubbleVerticalOverlap = 2;
// An offset distance between certain toolbars and the toolbar that preceded
// them in layout.
static const int kSeparationLineHeight = 1;
@@ -178,7 +178,9 @@
gfx::Rect BrowserView::GetClientAreaBounds() const {
gfx::Rect container_bounds = contents_container_->bounds();
- container_bounds.Offset(x(), y());
+ gfx::Point container_origin = container_bounds.origin();
+ ConvertPointToView(this, GetParent(), &container_origin);
+ container_bounds.set_origin(container_origin);
return container_bounds;
}
@@ -1127,10 +1129,11 @@
}
void BrowserView::LayoutStatusBubble(int top) {
- int status_bubble_y =
- top - kStatusBubbleHeight + kStatusBubbleVerticalOffset + y();
- status_bubble_->SetBounds(kStatusBubbleHorizontalOffset, status_bubble_y,
- width() / 3, kStatusBubbleHeight);
+ gfx::Point origin(-kStatusBubbleHorizontalOverlap,
+ top - kStatusBubbleHeight + kStatusBubbleVerticalOverlap);
+ ConvertPointToView(this, GetParent(), &origin);
+ status_bubble_->SetBounds(origin.x(), origin.y(), width() / 3,
+ kStatusBubbleHeight);
}
bool BrowserView::MaybeShowBookmarkBar(TabContents* contents) {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698