summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoroshima@chromium.org <oshima@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-02-02 19:00:32 +0000
committeroshima@chromium.org <oshima@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-02-02 19:00:32 +0000
commit41b06b2da057ccd20255295026dc5509a1b4a7d9 (patch)
treec93a362e7d2045c885bbc49abcae0b553336a568
parent527bb7f151b5f44c5274f9d27b13ee3b32ef9bf4 (diff)
downloadchromium_src-41b06b2da057ccd20255295026dc5509a1b4a7d9.zip
chromium_src-41b06b2da057ccd20255295026dc5509a1b4a7d9.tar.gz
chromium_src-41b06b2da057ccd20255295026dc5509a1b4a7d9.tar.bz2
Cleanup the code to adjust the size/location of compact navigation bar.
Clipping happens when the location is not in Root's vibible rect. I think this is good and general enough to be used with different layouts. BUG=none TEST=none Review URL: http://codereview.chromium.org/553177 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@37855 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/browser/chromeos/chromeos_browser_view.cc8
1 files changed, 4 insertions, 4 deletions
diff --git a/chrome/browser/chromeos/chromeos_browser_view.cc b/chrome/browser/chromeos/chromeos_browser_view.cc
index 057ada4..861c393 100644
--- a/chrome/browser/chromeos/chromeos_browser_view.cc
+++ b/chrome/browser/chromeos/chromeos_browser_view.cc
@@ -280,14 +280,14 @@ class ChromeosBrowserViewLayoutManager : public ChromeBrowserViewLayoutManager {
int remaining_width = bounds.width() - status_size.width();
if (compact_navigation_bar_->IsVisible()) {
- gfx::Size cnb_bounds = compact_navigation_bar_->GetPreferredSize();
+ gfx::Size cnb_size = compact_navigation_bar_->GetPreferredSize();
// Adjust the size of the compact nativation bar to avoid creating
// a fixed widget with its own gdk window. AutocompleteEditView
// expects the parent view to be transparent, but a fixed with
// its own window is not.
- compact_navigation_bar_->SetBounds(curx, bounds.y() + 1,
- cnb_bounds.width(),
- bounds.height() - 1);
+ gfx::Rect cnb_bounds(curx, bounds.y(), cnb_size.width(), bounds.height());
+ compact_navigation_bar_->SetBounds(
+ cnb_bounds.Intersect(browser_view_->GetVisibleBounds()));
curx += cnb_bounds.width();
remaining_width -= cnb_bounds.width();