| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include <algorithm> | 5 #include <algorithm> |
| 6 | 6 |
| 7 #include "app/gfx/canvas.h" | 7 #include "app/gfx/canvas.h" |
| 8 #include "app/menus/simple_menu_model.h" | 8 #include "app/menus/simple_menu_model.h" |
| 9 #include "app/theme_provider.h" | 9 #include "app/theme_provider.h" |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 171 status_area_->Update(); | 171 status_area_->Update(); |
| 172 gfx::Size status_size = status_area_->GetPreferredSize(); | 172 gfx::Size status_size = status_area_->GetPreferredSize(); |
| 173 status_area_->SetBounds(bounds.x() + bounds.width() - status_size.width(), | 173 status_area_->SetBounds(bounds.x() + bounds.width() - status_size.width(), |
| 174 bounds.y(), status_size.width(), | 174 bounds.y(), status_size.width(), |
| 175 status_size.height()); | 175 status_size.height()); |
| 176 int curx = bounds.x(); | 176 int curx = bounds.x(); |
| 177 int width = bounds.width() - status_size.width(); | 177 int width = bounds.width() - status_size.width(); |
| 178 | 178 |
| 179 if (compact_navigation_bar_->IsVisible()) { | 179 if (compact_navigation_bar_->IsVisible()) { |
| 180 gfx::Size cnb_bounds = compact_navigation_bar_->GetPreferredSize(); | 180 gfx::Size cnb_bounds = compact_navigation_bar_->GetPreferredSize(); |
| 181 compact_navigation_bar_->SetBounds(curx, bounds.y(), | 181 // This (+1/-1) is a quick hack for the bug |
| 182 // http://code.google.com/p/chromium-os/issues/detail?id=1010 |
| 183 // while investigating the issue. It could be in gtk or around |
| 184 // NativeViewHostGtk::CreateFixed, but it will take some time. |
| 185 compact_navigation_bar_->SetBounds(curx, bounds.y() + 1, |
| 182 cnb_bounds.width(), | 186 cnb_bounds.width(), |
| 183 bounds.height()); | 187 bounds.height() - 1); |
| 184 curx += cnb_bounds.width(); | 188 curx += cnb_bounds.width(); |
| 185 width -= cnb_bounds.width(); | 189 width -= cnb_bounds.width(); |
| 186 | 190 |
| 187 spacer_->SetVisible(true); | 191 spacer_->SetVisible(true); |
| 188 spacer_->SetBounds(0, *bottom, browser_view()->width(), | 192 spacer_->SetBounds(0, *bottom, browser_view()->width(), |
| 189 kCompactNavbarSpaceHeight); | 193 kCompactNavbarSpaceHeight); |
| 190 *bottom += kCompactNavbarSpaceHeight; | 194 *bottom += kCompactNavbarSpaceHeight; |
| 191 } else { | 195 } else { |
| 192 spacer_->SetVisible(false); | 196 spacer_->SetVisible(false); |
| 193 } | 197 } |
| (...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 431 //////////////////////////////////////////////////////////////////////////////// | 435 //////////////////////////////////////////////////////////////////////////////// |
| 432 // BrowserExtender, public: | 436 // BrowserExtender, public: |
| 433 | 437 |
| 434 // static | 438 // static |
| 435 BrowserExtender* BrowserExtender::Create(BrowserView* browser_view) { | 439 BrowserExtender* BrowserExtender::Create(BrowserView* browser_view) { |
| 436 if (browser_view->browser()->type() & Browser::TYPE_POPUP) | 440 if (browser_view->browser()->type() & Browser::TYPE_POPUP) |
| 437 return new PopupExtender(browser_view); | 441 return new PopupExtender(browser_view); |
| 438 else | 442 else |
| 439 return new NormalExtender(browser_view); | 443 return new NormalExtender(browser_view); |
| 440 } | 444 } |
| OLD | NEW |