| 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/omnibox/omnibox_view_views.h" | 5 #include "chrome/browser/ui/views/omnibox/omnibox_view_views.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "base/string_util.h" | 8 #include "base/string_util.h" |
| 9 #include "base/utf_string_conversions.h" | 9 #include "base/utf_string_conversions.h" |
| 10 #include "chrome/app/chrome_command_ids.h" | 10 #include "chrome/app/chrome_command_ids.h" |
| (...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 167 | 167 |
| 168 //////////////////////////////////////////////////////////////////////////////// | 168 //////////////////////////////////////////////////////////////////////////////// |
| 169 // OmniboxViewViews public: | 169 // OmniboxViewViews public: |
| 170 | 170 |
| 171 void OmniboxViewViews::Init() { | 171 void OmniboxViewViews::Init() { |
| 172 // The height of the text view is going to change based on the font used. We | 172 // The height of the text view is going to change based on the font used. We |
| 173 // don't want to stretch the height, and we want it vertically centered. | 173 // don't want to stretch the height, and we want it vertically centered. |
| 174 // TODO(oshima): make sure the above happens with views. | 174 // TODO(oshima): make sure the above happens with views. |
| 175 textfield_ = new AutocompleteTextfield(this); | 175 textfield_ = new AutocompleteTextfield(this); |
| 176 textfield_->SetController(this); | 176 textfield_->SetController(this); |
| 177 textfield_->SetUrl(true); |
| 177 | 178 |
| 178 #if defined(TOUCH_UI) | 179 #if defined(TOUCH_UI) |
| 179 textfield_->SetFont(ui::ResourceBundle::GetSharedInstance().GetFont( | 180 textfield_->SetFont(ui::ResourceBundle::GetSharedInstance().GetFont( |
| 180 ResourceBundle::LargeFont)); | 181 ResourceBundle::LargeFont)); |
| 181 #endif | 182 #endif |
| 182 | 183 |
| 183 if (popup_window_mode_) | 184 if (popup_window_mode_) |
| 184 textfield_->SetReadOnly(true); | 185 textfield_->SetReadOnly(true); |
| 185 | 186 |
| 186 // Manually invoke SetBaseColor() because TOOLKIT_VIEWS doesn't observe | 187 // Manually invoke SetBaseColor() because TOOLKIT_VIEWS doesn't observe |
| (...skipping 508 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 695 AutocompletePopupView* OmniboxViewViews::CreatePopupView( | 696 AutocompletePopupView* OmniboxViewViews::CreatePopupView( |
| 696 View* location_bar) { | 697 View* location_bar) { |
| 697 #if defined(TOUCH_UI) | 698 #if defined(TOUCH_UI) |
| 698 typedef TouchAutocompletePopupContentsView AutocompleteContentsView; | 699 typedef TouchAutocompletePopupContentsView AutocompleteContentsView; |
| 699 #else | 700 #else |
| 700 typedef AutocompletePopupContentsView AutocompleteContentsView; | 701 typedef AutocompletePopupContentsView AutocompleteContentsView; |
| 701 #endif | 702 #endif |
| 702 return new AutocompleteContentsView(gfx::Font(), this, model_.get(), | 703 return new AutocompleteContentsView(gfx::Font(), this, model_.get(), |
| 703 location_bar); | 704 location_bar); |
| 704 } | 705 } |
| OLD | NEW |