| OLD | NEW |
| 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/omnibox/omnibox_view_views.h" | 5 #include "chrome/browser/ui/views/omnibox/omnibox_view_views.h" |
| 6 | 6 |
| 7 #include "base/property_bag.h" | 7 #include "base/property_bag.h" |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "base/string_util.h" | 9 #include "base/string_util.h" |
| 10 #include "base/utf_string_conversions.h" | 10 #include "base/utf_string_conversions.h" |
| (...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 208 if (popup_window_mode_) | 208 if (popup_window_mode_) |
| 209 textfield_->SetReadOnly(true); | 209 textfield_->SetReadOnly(true); |
| 210 | 210 |
| 211 const int font_size = GetEditFontPixelSize(popup_window_mode_); | 211 const int font_size = GetEditFontPixelSize(popup_window_mode_); |
| 212 const int old_size = textfield_->font().GetFontSize(); | 212 const int old_size = textfield_->font().GetFontSize(); |
| 213 if (font_size != old_size) | 213 if (font_size != old_size) |
| 214 textfield_->SetFont(textfield_->font().DeriveFont(font_size - old_size)); | 214 textfield_->SetFont(textfield_->font().DeriveFont(font_size - old_size)); |
| 215 | 215 |
| 216 // Create popup view using the same font as |textfield_|'s. | 216 // Create popup view using the same font as |textfield_|'s. |
| 217 popup_view_.reset( | 217 popup_view_.reset( |
| 218 new AutocompletePopupContentsView( | 218 AutocompletePopupContentsView::CreateForEnvironment( |
| 219 textfield_->font(), this, model_.get(), location_bar_view_)); | 219 textfield_->font(), this, model_.get(), location_bar_view_)); |
| 220 | 220 |
| 221 const int vertical_margin = !popup_window_mode_ ? | 221 const int vertical_margin = !popup_window_mode_ ? |
| 222 kAutocompleteVerticalMargin : kAutocompleteVerticalMarginInPopup; | 222 kAutocompleteVerticalMargin : kAutocompleteVerticalMarginInPopup; |
| 223 set_border(views::Border::CreateEmptyBorder(vertical_margin, 0, | 223 set_border(views::Border::CreateEmptyBorder(vertical_margin, 0, |
| 224 vertical_margin, 0)); | 224 vertical_margin, 0)); |
| 225 #if defined(OS_CHROMEOS) | 225 #if defined(OS_CHROMEOS) |
| 226 chromeos::input_method::InputMethodManager::GetInstance()-> | 226 chromeos::input_method::InputMethodManager::GetInstance()-> |
| 227 AddCandidateWindowObserver(this); | 227 AddCandidateWindowObserver(this); |
| 228 #endif | 228 #endif |
| (...skipping 625 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 854 OmniboxViewViews* omnibox_view = new OmniboxViewViews(controller, | 854 OmniboxViewViews* omnibox_view = new OmniboxViewViews(controller, |
| 855 toolbar_model, | 855 toolbar_model, |
| 856 profile, | 856 profile, |
| 857 command_updater, | 857 command_updater, |
| 858 popup_window_mode, | 858 popup_window_mode, |
| 859 location_bar); | 859 location_bar); |
| 860 omnibox_view->Init(); | 860 omnibox_view->Init(); |
| 861 return omnibox_view; | 861 return omnibox_view; |
| 862 } | 862 } |
| 863 #endif | 863 #endif |
| OLD | NEW |