| 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 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 191 | 191 |
| 192 // Initialize the Omnibox view. | 192 // Initialize the Omnibox view. |
| 193 omnibox_view_ = new OmniboxViewViews( | 193 omnibox_view_ = new OmniboxViewViews( |
| 194 this, base::MakeUnique<ChromeOmniboxClient>(this, profile()), | 194 this, base::MakeUnique<ChromeOmniboxClient>(this, profile()), |
| 195 command_updater(), is_popup_mode_, this, font_list); | 195 command_updater(), is_popup_mode_, this, font_list); |
| 196 omnibox_view_->Init(); | 196 omnibox_view_->Init(); |
| 197 AddChildView(omnibox_view_); | 197 AddChildView(omnibox_view_); |
| 198 | 198 |
| 199 // Initialize the inline autocomplete view which is visible only when IME is | 199 // Initialize the inline autocomplete view which is visible only when IME is |
| 200 // turned on. Use the same font with the omnibox and highlighted background. | 200 // turned on. Use the same font with the omnibox and highlighted background. |
| 201 ime_inline_autocomplete_view_ = new views::Label(base::string16(), font_list); | 201 ime_inline_autocomplete_view_ = |
| 202 new views::Label(base::string16(), {font_list}); |
| 202 ime_inline_autocomplete_view_->SetHorizontalAlignment(gfx::ALIGN_LEFT); | 203 ime_inline_autocomplete_view_->SetHorizontalAlignment(gfx::ALIGN_LEFT); |
| 203 ime_inline_autocomplete_view_->SetAutoColorReadabilityEnabled(false); | 204 ime_inline_autocomplete_view_->SetAutoColorReadabilityEnabled(false); |
| 204 ime_inline_autocomplete_view_->set_background( | 205 ime_inline_autocomplete_view_->set_background( |
| 205 views::Background::CreateSolidBackground(GetNativeTheme()->GetSystemColor( | 206 views::Background::CreateSolidBackground(GetNativeTheme()->GetSystemColor( |
| 206 ui::NativeTheme::kColorId_TextfieldSelectionBackgroundFocused))); | 207 ui::NativeTheme::kColorId_TextfieldSelectionBackgroundFocused))); |
| 207 ime_inline_autocomplete_view_->SetEnabledColor( | 208 ime_inline_autocomplete_view_->SetEnabledColor( |
| 208 GetNativeTheme()->GetSystemColor( | 209 GetNativeTheme()->GetSystemColor( |
| 209 ui::NativeTheme::kColorId_TextfieldSelectionColor)); | 210 ui::NativeTheme::kColorId_TextfieldSelectionColor)); |
| 210 ime_inline_autocomplete_view_->SetVisible(false); | 211 ime_inline_autocomplete_view_->SetVisible(false); |
| 211 AddChildView(ime_inline_autocomplete_view_); | 212 AddChildView(ime_inline_autocomplete_view_); |
| (...skipping 855 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1067 // LocationBarView, private TemplateURLServiceObserver implementation: | 1068 // LocationBarView, private TemplateURLServiceObserver implementation: |
| 1068 | 1069 |
| 1069 void LocationBarView::OnTemplateURLServiceChanged() { | 1070 void LocationBarView::OnTemplateURLServiceChanged() { |
| 1070 template_url_service_->RemoveObserver(this); | 1071 template_url_service_->RemoveObserver(this); |
| 1071 template_url_service_ = nullptr; | 1072 template_url_service_ = nullptr; |
| 1072 // If the browser is no longer active, let's not show the info bubble, as this | 1073 // If the browser is no longer active, let's not show the info bubble, as this |
| 1073 // would make the browser the active window again. | 1074 // would make the browser the active window again. |
| 1074 if (omnibox_view_ && omnibox_view_->GetWidget()->IsActive()) | 1075 if (omnibox_view_ && omnibox_view_->GetWidget()->IsActive()) |
| 1075 ShowFirstRunBubble(); | 1076 ShowFirstRunBubble(); |
| 1076 } | 1077 } |
| OLD | NEW |