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/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/i18n/rtl.h" | 10 #include "base/i18n/rtl.h" |
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
194 | 194 |
195 // Initialize the Omnibox view. | 195 // Initialize the Omnibox view. |
196 omnibox_view_ = new OmniboxViewViews( | 196 omnibox_view_ = new OmniboxViewViews( |
197 this, base::MakeUnique<ChromeOmniboxClient>(this, profile()), | 197 this, base::MakeUnique<ChromeOmniboxClient>(this, profile()), |
198 command_updater(), is_popup_mode_, this, font_list); | 198 command_updater(), is_popup_mode_, this, font_list); |
199 omnibox_view_->Init(); | 199 omnibox_view_->Init(); |
200 AddChildView(omnibox_view_); | 200 AddChildView(omnibox_view_); |
201 | 201 |
202 // Initialize the inline autocomplete view which is visible only when IME is | 202 // Initialize the inline autocomplete view which is visible only when IME is |
203 // turned on. Use the same font with the omnibox and highlighted background. | 203 // turned on. Use the same font with the omnibox and highlighted background. |
204 ime_inline_autocomplete_view_ = new views::Label(base::string16(), font_list); | 204 ime_inline_autocomplete_view_ = |
| 205 new views::Label(base::string16(), views::Label::CustomFont{font_list}); |
205 ime_inline_autocomplete_view_->SetHorizontalAlignment(gfx::ALIGN_LEFT); | 206 ime_inline_autocomplete_view_->SetHorizontalAlignment(gfx::ALIGN_LEFT); |
206 ime_inline_autocomplete_view_->SetAutoColorReadabilityEnabled(false); | 207 ime_inline_autocomplete_view_->SetAutoColorReadabilityEnabled(false); |
207 ime_inline_autocomplete_view_->set_background( | 208 ime_inline_autocomplete_view_->set_background( |
208 views::Background::CreateSolidBackground(GetNativeTheme()->GetSystemColor( | 209 views::Background::CreateSolidBackground(GetNativeTheme()->GetSystemColor( |
209 ui::NativeTheme::kColorId_TextfieldSelectionBackgroundFocused))); | 210 ui::NativeTheme::kColorId_TextfieldSelectionBackgroundFocused))); |
210 ime_inline_autocomplete_view_->SetEnabledColor( | 211 ime_inline_autocomplete_view_->SetEnabledColor( |
211 GetNativeTheme()->GetSystemColor( | 212 GetNativeTheme()->GetSystemColor( |
212 ui::NativeTheme::kColorId_TextfieldSelectionColor)); | 213 ui::NativeTheme::kColorId_TextfieldSelectionColor)); |
213 ime_inline_autocomplete_view_->SetVisible(false); | 214 ime_inline_autocomplete_view_->SetVisible(false); |
214 AddChildView(ime_inline_autocomplete_view_); | 215 AddChildView(ime_inline_autocomplete_view_); |
(...skipping 995 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1210 // LocationBarView, private TemplateURLServiceObserver implementation: | 1211 // LocationBarView, private TemplateURLServiceObserver implementation: |
1211 | 1212 |
1212 void LocationBarView::OnTemplateURLServiceChanged() { | 1213 void LocationBarView::OnTemplateURLServiceChanged() { |
1213 template_url_service_->RemoveObserver(this); | 1214 template_url_service_->RemoveObserver(this); |
1214 template_url_service_ = nullptr; | 1215 template_url_service_ = nullptr; |
1215 // If the browser is no longer active, let's not show the info bubble, as this | 1216 // If the browser is no longer active, let's not show the info bubble, as this |
1216 // would make the browser the active window again. | 1217 // would make the browser the active window again. |
1217 if (omnibox_view_ && omnibox_view_->GetWidget()->IsActive()) | 1218 if (omnibox_view_ && omnibox_view_->GetWidget()->IsActive()) |
1218 ShowFirstRunBubble(); | 1219 ShowFirstRunBubble(); |
1219 } | 1220 } |
OLD | NEW |