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

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

Issue 21042013: Have SearchProvider look up the omnibox start margin directly. (Closed) Base URL: https://git.chromium.org/chromium/src.git@master
Patch Set: Rebase and respond to comments. Created 7 years, 4 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 #include <algorithm> 7 #include <algorithm>
8 #include <map> 8 #include <map>
9 9
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 1060 matching lines...) Expand 10 before | Expand all | Expand 10 after
1071 } 1071 }
1072 1072
1073 InstantController* LocationBarView::GetInstant() { 1073 InstantController* LocationBarView::GetInstant() {
1074 return delegate_->GetInstant(); 1074 return delegate_->GetInstant();
1075 } 1075 }
1076 1076
1077 WebContents* LocationBarView::GetWebContents() const { 1077 WebContents* LocationBarView::GetWebContents() const {
1078 return delegate_->GetWebContents(); 1078 return delegate_->GetWebContents();
1079 } 1079 }
1080 1080
1081 gfx::Rect LocationBarView::GetOmniboxBounds() const {
1082 return bounds();
1083 }
1084
1085 int LocationBarView::GetHorizontalEdgeThickness() const { 1081 int LocationBarView::GetHorizontalEdgeThickness() const {
1086 // In maximized popup mode, there isn't any edge. 1082 // In maximized popup mode, there isn't any edge.
1087 return (is_popup_mode_ && browser_ && browser_->window() && 1083 return (is_popup_mode_ && browser_ && browser_->window() &&
1088 browser_->window()->IsMaximized()) ? 0 : vertical_edge_thickness(); 1084 browser_->window()->IsMaximized()) ? 0 : vertical_edge_thickness();
1089 } 1085 }
1090 1086
1091 void LocationBarView::RefreshContentSettingViews() { 1087 void LocationBarView::RefreshContentSettingViews() {
1092 for (ContentSettingViews::const_iterator i(content_setting_views_.begin()); 1088 for (ContentSettingViews::const_iterator i(content_setting_views_.begin());
1093 i != content_setting_views_.end(); ++i) { 1089 i != content_setting_views_.end(); ++i) {
1094 (*i)->Update(model_->GetInputInProgress() ? NULL : GetWebContents()); 1090 (*i)->Update(model_->GetInputInProgress() ? NULL : GetWebContents());
(...skipping 411 matching lines...) Expand 10 before | Expand all | Expand 10 after
1506 int LocationBarView::GetInternalHeight(bool use_preferred_size) { 1502 int LocationBarView::GetInternalHeight(bool use_preferred_size) {
1507 int total_height = 1503 int total_height =
1508 use_preferred_size ? GetPreferredSize().height() : height(); 1504 use_preferred_size ? GetPreferredSize().height() : height();
1509 return std::max(total_height - (vertical_edge_thickness() * 2), 0); 1505 return std::max(total_height - (vertical_edge_thickness() * 2), 0);
1510 } 1506 }
1511 1507
1512 bool LocationBarView::HasValidSuggestText() const { 1508 bool LocationBarView::HasValidSuggestText() const {
1513 return suggested_text_view_->visible() && 1509 return suggested_text_view_->visible() &&
1514 !suggested_text_view_->size().IsEmpty(); 1510 !suggested_text_view_->size().IsEmpty();
1515 } 1511 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698