OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "chrome/browser/ui/views/location_bar/location_bar_view.h" | 5 #include "chrome/browser/ui/views/location_bar/location_bar_view.h" |
6 | 6 |
7 #if defined(TOOLKIT_USES_GTK) | 7 #if defined(TOOLKIT_USES_GTK) |
8 #include <gtk/gtk.h> | 8 #include <gtk/gtk.h> |
9 #endif | 9 #endif |
10 | 10 |
(...skipping 453 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
464 | 464 |
465 gfx::Size LocationBarView::GetPreferredSize() { | 465 gfx::Size LocationBarView::GetPreferredSize() { |
466 return gfx::Size(0, GetThemeProvider()->GetBitmapNamed(mode_ == POPUP ? | 466 return gfx::Size(0, GetThemeProvider()->GetBitmapNamed(mode_ == POPUP ? |
467 IDR_LOCATIONBG_POPUPMODE_CENTER : IDR_LOCATIONBG_C)->height()); | 467 IDR_LOCATIONBG_POPUPMODE_CENTER : IDR_LOCATIONBG_C)->height()); |
468 } | 468 } |
469 | 469 |
470 void LocationBarView::Layout() { | 470 void LocationBarView::Layout() { |
471 if (!location_entry_.get()) | 471 if (!location_entry_.get()) |
472 return; | 472 return; |
473 | 473 |
| 474 // TODO(jhawkins): Remove once crbug.com/101994 is fixed. |
| 475 CHECK(location_icon_view_); |
| 476 |
474 // TODO(sky): baseline layout. | 477 // TODO(sky): baseline layout. |
475 int location_y = kVerticalEdgeThickness; | 478 int location_y = kVerticalEdgeThickness; |
476 // In some cases (e.g. fullscreen mode) we may have 0 height. We still want | 479 // In some cases (e.g. fullscreen mode) we may have 0 height. We still want |
477 // to position our child views in this case, because other things may be | 480 // to position our child views in this case, because other things may be |
478 // positioned relative to them (e.g. the "bookmark added" bubble if the user | 481 // positioned relative to them (e.g. the "bookmark added" bubble if the user |
479 // hits ctrl-d). | 482 // hits ctrl-d). |
480 int location_height = std::max(height() - (kVerticalEdgeThickness * 2), 0); | 483 int location_height = std::max(height() - (kVerticalEdgeThickness * 2), 0); |
481 | 484 |
482 // The edge stroke is 1 px thick. In popup mode, the edges are drawn by the | 485 // The edge stroke is 1 px thick. In popup mode, the edges are drawn by the |
483 // omnibox' parent, so there isn't any edge to account for at all. | 486 // omnibox' parent, so there isn't any edge to account for at all. |
(...skipping 789 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1273 !suggested_text_view_->GetText().empty(); | 1276 !suggested_text_view_->GetText().empty(); |
1274 } | 1277 } |
1275 | 1278 |
1276 #if !defined(USE_AURA) | 1279 #if !defined(USE_AURA) |
1277 OmniboxViewWin* LocationBarView::GetOmniboxViewWin() { | 1280 OmniboxViewWin* LocationBarView::GetOmniboxViewWin() { |
1278 CHECK(!views::Widget::IsPureViews()); | 1281 CHECK(!views::Widget::IsPureViews()); |
1279 return static_cast<OmniboxViewWin*>(location_entry_.get()); | 1282 return static_cast<OmniboxViewWin*>(location_entry_.get()); |
1280 } | 1283 } |
1281 #endif | 1284 #endif |
1282 #endif | 1285 #endif |
OLD | NEW |