Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(130)

Side by Side Diff: chrome/browser/ui/views/location_bar/location_bar_view.cc

Issue 2816193002: Introduce a type of View background that stays in sync with its host (Closed)
Patch Set: tdanderson review + rebase Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 181 matching lines...) Expand 10 before | Expand all | Expand 10 after
192 omnibox_view_->Init(); 192 omnibox_view_->Init();
193 AddChildView(omnibox_view_); 193 AddChildView(omnibox_view_);
194 194
195 // Initialize the inline autocomplete view which is visible only when IME is 195 // Initialize the inline autocomplete view which is visible only when IME is
196 // turned on. Use the same font with the omnibox and highlighted background. 196 // turned on. Use the same font with the omnibox and highlighted background.
197 ime_inline_autocomplete_view_ = 197 ime_inline_autocomplete_view_ =
198 new views::Label(base::string16(), {font_list}); 198 new views::Label(base::string16(), {font_list});
199 ime_inline_autocomplete_view_->SetHorizontalAlignment(gfx::ALIGN_LEFT); 199 ime_inline_autocomplete_view_->SetHorizontalAlignment(gfx::ALIGN_LEFT);
200 ime_inline_autocomplete_view_->SetAutoColorReadabilityEnabled(false); 200 ime_inline_autocomplete_view_->SetAutoColorReadabilityEnabled(false);
201 ime_inline_autocomplete_view_->set_background( 201 ime_inline_autocomplete_view_->set_background(
202 views::Background::CreateSolidBackground(GetNativeTheme()->GetSystemColor( 202 views::Background::CreateThemedSolidBackground(
203 ui::NativeTheme::kColorId_TextfieldSelectionBackgroundFocused))); 203 ime_inline_autocomplete_view_,
204 ui::NativeTheme::kColorId_TextfieldSelectionBackgroundFocused));
204 ime_inline_autocomplete_view_->SetEnabledColor( 205 ime_inline_autocomplete_view_->SetEnabledColor(
msw 2017/04/19 19:00:54 This label's foreground color doesn't change with
Evan Stade 2017/04/20 04:44:22 I didn't really intend to fix all native theming i
msw 2017/04/20 18:21:45 I just think this isn't as simple as it seems; "fi
Evan Stade 2017/04/20 21:18:45 It's also quite possible that bugs go the other di
205 GetNativeTheme()->GetSystemColor( 206 GetNativeTheme()->GetSystemColor(
206 ui::NativeTheme::kColorId_TextfieldSelectionColor)); 207 ui::NativeTheme::kColorId_TextfieldSelectionColor));
207 ime_inline_autocomplete_view_->SetVisible(false); 208 ime_inline_autocomplete_view_->SetVisible(false);
208 AddChildView(ime_inline_autocomplete_view_); 209 AddChildView(ime_inline_autocomplete_view_);
209 210
210 selected_keyword_view_ = new SelectedKeywordView(font_list, profile()); 211 selected_keyword_view_ = new SelectedKeywordView(font_list, profile());
211 AddChildView(selected_keyword_view_); 212 AddChildView(selected_keyword_view_);
212 213
213 gfx::FontList bubble_font_list = 214 gfx::FontList bubble_font_list =
214 font_list.DeriveWithHeightUpperBound(bubble_height); 215 font_list.DeriveWithHeightUpperBound(bubble_height);
(...skipping 825 matching lines...) Expand 10 before | Expand all | Expand 10 after
1040 // LocationBarView, private TemplateURLServiceObserver implementation: 1041 // LocationBarView, private TemplateURLServiceObserver implementation:
1041 1042
1042 void LocationBarView::OnTemplateURLServiceChanged() { 1043 void LocationBarView::OnTemplateURLServiceChanged() {
1043 template_url_service_->RemoveObserver(this); 1044 template_url_service_->RemoveObserver(this);
1044 template_url_service_ = nullptr; 1045 template_url_service_ = nullptr;
1045 // If the browser is no longer active, let's not show the info bubble, as this 1046 // If the browser is no longer active, let's not show the info bubble, as this
1046 // would make the browser the active window again. 1047 // would make the browser the active window again.
1047 if (omnibox_view_ && omnibox_view_->GetWidget()->IsActive()) 1048 if (omnibox_view_ && omnibox_view_->GetWidget()->IsActive())
1048 ShowFirstRunBubble(); 1049 ShowFirstRunBubble();
1049 } 1050 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698