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

Unified Diff: chrome/browser/ui/views/omnibox/omnibox_view_views.cc

Issue 120503005: Merge NativeTextfieldViews into views::Textfield. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rename GetText to text. Created 6 years, 11 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/views/omnibox/omnibox_view_views.cc
diff --git a/chrome/browser/ui/views/omnibox/omnibox_view_views.cc b/chrome/browser/ui/views/omnibox/omnibox_view_views.cc
index 4ba3789b5d8183326b50af945843607092dbaabe..ccb960e3e83bc5a9f743fe3a8ad4e662b5c90b58 100644
--- a/chrome/browser/ui/views/omnibox/omnibox_view_views.cc
+++ b/chrome/browser/ui/views/omnibox/omnibox_view_views.cc
@@ -44,7 +44,6 @@
#include "ui/gfx/selection_model.h"
#include "ui/views/border.h"
#include "ui/views/button_drag_utils.h"
-#include "ui/views/controls/textfield/native_textfield_views.h"
#include "ui/views/controls/textfield/textfield.h"
#include "ui/views/ime/input_method.h"
#include "ui/views/layout/fill_layout.h"
@@ -176,7 +175,7 @@ void OmniboxViewViews::Init() {
// Initialize the popup view using the same font.
popup_view_.reset(OmniboxPopupContentsView::Create(
- font_list(), this, model(), location_bar_view_));
+ GetFontList(), this, model(), location_bar_view_));
#if defined(OS_CHROMEOS)
chromeos::input_method::InputMethodManager::Get()->
@@ -674,7 +673,9 @@ base::string16 OmniboxViewViews::GetGrayTextAutocompletion() const {
}
int OmniboxViewViews::GetTextWidth() const {
- return textfield_view_->GetWidthNeededForText();
+ // Returns the width necessary to display the current text, including any
+ // necessary space for the cursor or border/margin.
+ return GetRenderText()->GetContentWidth() + GetInsets().width();
}
int OmniboxViewViews::GetWidth() const {

Powered by Google App Engine
This is Rietveld 408576698