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

Side by Side Diff: chrome/browser/ui/views/location_bar/location_bar_view.cc

Issue 8418010: LocationBarView: Add a CHECK to help debug a crash. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 1 month 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« 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