Chromium Code Reviews| 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/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 241 const SkColor background_color = GetColor(BACKGROUND); | 241 const SkColor background_color = GetColor(BACKGROUND); |
| 242 location_icon_view_ = new LocationIconView(font_list, this); | 242 location_icon_view_ = new LocationIconView(font_list, this); |
| 243 location_icon_view_->set_drag_controller(this); | 243 location_icon_view_->set_drag_controller(this); |
| 244 AddChildView(location_icon_view_); | 244 AddChildView(location_icon_view_); |
| 245 | 245 |
| 246 // Initialize the Omnibox view. | 246 // Initialize the Omnibox view. |
| 247 omnibox_view_ = new OmniboxViewViews( | 247 omnibox_view_ = new OmniboxViewViews( |
| 248 this, profile(), command_updater(), is_popup_mode_, this, font_list); | 248 this, profile(), command_updater(), is_popup_mode_, this, font_list); |
| 249 omnibox_view_->Init(); | 249 omnibox_view_->Init(); |
| 250 omnibox_view_->SetFocusBehavior(FocusBehavior::ALWAYS); | 250 omnibox_view_->SetFocusBehavior(FocusBehavior::ALWAYS); |
| 251 omnibox_view_->SetBorder(views::CreateEmptyBorder(0, 0, 0, 0)); | |
|
Marc Treib
2016/11/25 10:25:41
Turns out that SetBorder call did something after
Peter Kasting
2016/11/26 06:15:35
So what does this do? It's not at all apparent to
Marc Treib
2016/11/28 10:46:48
views::Textfield has a FocusableBorder by default:
Peter Kasting
2016/11/28 20:00:13
Interesting. So I guess the comment on all this s
Marc Treib
2016/11/29 14:10:06
Done.
| |
| 251 AddChildView(omnibox_view_); | 252 AddChildView(omnibox_view_); |
| 252 | 253 |
| 253 // Initialize the inline autocomplete view which is visible only when IME is | 254 // Initialize the inline autocomplete view which is visible only when IME is |
| 254 // turned on. Use the same font with the omnibox and highlighted background. | 255 // turned on. Use the same font with the omnibox and highlighted background. |
| 255 ime_inline_autocomplete_view_ = new views::Label(base::string16(), font_list); | 256 ime_inline_autocomplete_view_ = new views::Label(base::string16(), font_list); |
| 256 ime_inline_autocomplete_view_->SetHorizontalAlignment(gfx::ALIGN_LEFT); | 257 ime_inline_autocomplete_view_->SetHorizontalAlignment(gfx::ALIGN_LEFT); |
| 257 ime_inline_autocomplete_view_->SetAutoColorReadabilityEnabled(false); | 258 ime_inline_autocomplete_view_->SetAutoColorReadabilityEnabled(false); |
| 258 ime_inline_autocomplete_view_->set_background( | 259 ime_inline_autocomplete_view_->set_background( |
| 259 views::Background::CreateSolidBackground(GetNativeTheme()->GetSystemColor( | 260 views::Background::CreateSolidBackground(GetNativeTheme()->GetSystemColor( |
| 260 ui::NativeTheme::kColorId_TextfieldSelectionBackgroundFocused))); | 261 ui::NativeTheme::kColorId_TextfieldSelectionBackgroundFocused))); |
| (...skipping 1001 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1262 // LocationBarView, private TemplateURLServiceObserver implementation: | 1263 // LocationBarView, private TemplateURLServiceObserver implementation: |
| 1263 | 1264 |
| 1264 void LocationBarView::OnTemplateURLServiceChanged() { | 1265 void LocationBarView::OnTemplateURLServiceChanged() { |
| 1265 template_url_service_->RemoveObserver(this); | 1266 template_url_service_->RemoveObserver(this); |
| 1266 template_url_service_ = nullptr; | 1267 template_url_service_ = nullptr; |
| 1267 // If the browser is no longer active, let's not show the info bubble, as this | 1268 // If the browser is no longer active, let's not show the info bubble, as this |
| 1268 // would make the browser the active window again. | 1269 // would make the browser the active window again. |
| 1269 if (omnibox_view_ && omnibox_view_->GetWidget()->IsActive()) | 1270 if (omnibox_view_ && omnibox_view_->GetWidget()->IsActive()) |
| 1270 ShowFirstRunBubble(); | 1271 ShowFirstRunBubble(); |
| 1271 } | 1272 } |
| OLD | NEW |