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

Unified Diff: chrome/browser/ui/views/location_bar/location_bar_view.cc

Issue 12299003: Merge AutocompleteTextfield views::Textfield subclass into OmniboxView. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Remove VIEW_ID_AUTOCOMPLETE in favor of VIEW_ID_OMNIBOX. Created 7 years, 10 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/location_bar/location_bar_view.cc
diff --git a/chrome/browser/ui/views/location_bar/location_bar_view.cc b/chrome/browser/ui/views/location_bar/location_bar_view.cc
index cb8ae209c32713cacb9b619a8f9c7e3810f46502..0be72e3e604c7e82770552f92430235159e52604 100644
--- a/chrome/browser/ui/views/location_bar/location_bar_view.cc
+++ b/chrome/browser/ui/views/location_bar/location_bar_view.cc
@@ -243,14 +243,11 @@ void LocationBarView::Init() {
ev_bubble_view_->set_drag_controller(this);
AddChildView(ev_bubble_view_);
- // URL edit field.
- // View container for URL edit field.
+ // Initialize the Omnibox view.
location_entry_.reset(CreateOmniboxView(this, model_, profile_,
command_updater_, mode_ == POPUP, this));
SetLocationEntryFocusable(true);
-
location_entry_view_ = location_entry_->AddToView(this);
- location_entry_view_->set_id(VIEW_ID_AUTOCOMPLETE);
selected_keyword_view_ = new SelectedKeywordView(
kSelectedKeywordBackgroundImages, IDR_KEYWORD_SEARCH_MAGNIFIER,
@@ -630,16 +627,14 @@ string16 LocationBarView::GetInstantSuggestion() const {
void LocationBarView::SetLocationEntryFocusable(bool focusable) {
OmniboxViewViews* omnibox_views = GetOmniboxViewViews(location_entry_.get());
if (omnibox_views)
- omnibox_views->SetLocationEntryFocusable(focusable);
+ omnibox_views->set_focusable(focusable);
else
set_focusable(focusable);
}
bool LocationBarView::IsLocationEntryFocusableInRootView() const {
OmniboxViewViews* omnibox_views = GetOmniboxViewViews(location_entry_.get());
- if (omnibox_views)
- return omnibox_views->IsLocationEntryFocusableInRootView();
- return views::View::IsFocusable();
+ return omnibox_views ? omnibox_views->IsFocusable() : View::IsFocusable();
}
gfx::Size LocationBarView::GetPreferredSize() {

Powered by Google App Engine
This is Rietveld 408576698