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 211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
222 const SkColor background_color = GetColor(BACKGROUND); | 222 const SkColor background_color = GetColor(BACKGROUND); |
223 location_icon_view_ = | 223 location_icon_view_ = |
224 new LocationIconView(bubble_font_list, background_color, this); | 224 new LocationIconView(bubble_font_list, background_color, this); |
225 location_icon_view_->set_drag_controller(this); | 225 location_icon_view_->set_drag_controller(this); |
226 AddChildView(location_icon_view_); | 226 AddChildView(location_icon_view_); |
227 | 227 |
228 // Initialize the Omnibox view. | 228 // Initialize the Omnibox view. |
229 omnibox_view_ = new OmniboxViewViews( | 229 omnibox_view_ = new OmniboxViewViews( |
230 this, profile(), command_updater(), is_popup_mode_, this, font_list); | 230 this, profile(), command_updater(), is_popup_mode_, this, font_list); |
231 omnibox_view_->Init(); | 231 omnibox_view_->Init(); |
232 omnibox_view_->SetFocusable(true); | 232 omnibox_view_->SetFocusBehavior(views::View::FocusBehavior::ALWAYS); |
233 AddChildView(omnibox_view_); | 233 AddChildView(omnibox_view_); |
234 | 234 |
235 // Initialize the inline autocomplete view which is visible only when IME is | 235 // Initialize the inline autocomplete view which is visible only when IME is |
236 // turned on. Use the same font with the omnibox and highlighted background. | 236 // turned on. Use the same font with the omnibox and highlighted background. |
237 ime_inline_autocomplete_view_ = new views::Label(base::string16(), font_list); | 237 ime_inline_autocomplete_view_ = new views::Label(base::string16(), font_list); |
238 ime_inline_autocomplete_view_->SetHorizontalAlignment(gfx::ALIGN_LEFT); | 238 ime_inline_autocomplete_view_->SetHorizontalAlignment(gfx::ALIGN_LEFT); |
239 ime_inline_autocomplete_view_->SetAutoColorReadabilityEnabled(false); | 239 ime_inline_autocomplete_view_->SetAutoColorReadabilityEnabled(false); |
240 ime_inline_autocomplete_view_->set_background( | 240 ime_inline_autocomplete_view_->set_background( |
241 views::Background::CreateSolidBackground(GetNativeTheme()->GetSystemColor( | 241 views::Background::CreateSolidBackground(GetNativeTheme()->GetSystemColor( |
242 ui::NativeTheme::kColorId_TextfieldSelectionBackgroundFocused))); | 242 ui::NativeTheme::kColorId_TextfieldSelectionBackgroundFocused))); |
(...skipping 1141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1384 // LocationBarView, private TemplateURLServiceObserver implementation: | 1384 // LocationBarView, private TemplateURLServiceObserver implementation: |
1385 | 1385 |
1386 void LocationBarView::OnTemplateURLServiceChanged() { | 1386 void LocationBarView::OnTemplateURLServiceChanged() { |
1387 template_url_service_->RemoveObserver(this); | 1387 template_url_service_->RemoveObserver(this); |
1388 template_url_service_ = nullptr; | 1388 template_url_service_ = nullptr; |
1389 // If the browser is no longer active, let's not show the info bubble, as this | 1389 // If the browser is no longer active, let's not show the info bubble, as this |
1390 // would make the browser the active window again. | 1390 // would make the browser the active window again. |
1391 if (omnibox_view_ && omnibox_view_->GetWidget()->IsActive()) | 1391 if (omnibox_view_ && omnibox_view_->GetWidget()->IsActive()) |
1392 ShowFirstRunBubble(); | 1392 ShowFirstRunBubble(); |
1393 } | 1393 } |
OLD | NEW |