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

Side by Side Diff: chrome/browser/ui/views/omnibox/omnibox_result_view.cc

Issue 13722014: linux_aura: Ask the NativeTheme for various colors which were hardcoded. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 // For WinDDK ATL compatibility, these ATL headers must come first. 5 // For WinDDK ATL compatibility, these ATL headers must come first.
6 #include "build/build_config.h" 6 #include "build/build_config.h"
7 #if defined(OS_WIN) 7 #if defined(OS_WIN)
8 #include <atlbase.h> // NOLINT 8 #include <atlbase.h> // NOLINT
9 #include <atlwin.h> // NOLINT 9 #include <atlwin.h> // NOLINT
10 #endif 10 #endif
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after
152 color_utils::GetSysSkColor(COLOR_HIGHLIGHTTEXT); 152 color_utils::GetSysSkColor(COLOR_HIGHLIGHTTEXT);
153 CommonInitColors(theme, win_colors); 153 CommonInitColors(theme, win_colors);
154 win_initialized = true; 154 win_initialized = true;
155 } 155 }
156 return win_colors[state][kind]; 156 return win_colors[state][kind];
157 } 157 }
158 #endif 158 #endif
159 static bool initialized = false; 159 static bool initialized = false;
160 static SkColor colors[NUM_STATES][NUM_KINDS]; 160 static SkColor colors[NUM_STATES][NUM_KINDS];
161 if (!initialized) { 161 if (!initialized) {
162 colors[NORMAL][BACKGROUND] = theme->GetSystemColor(
sky 2013/04/05 23:05:52 Won't this clobber the values set above (such as 1
Elliot Glaysher 2013/04/05 23:07:52 That's in a different static array. colors != win_
163 ui::NativeTheme::kColorId_TextfieldDefaultBackground);
164 colors[NORMAL][TEXT] = theme->GetSystemColor(
165 ui::NativeTheme::kColorId_TextfieldDefaultColor);
166 colors[NORMAL][URL] = SkColorSetARGB(0xff, 0x00, 0x99, 0x33);
162 colors[SELECTED][BACKGROUND] = theme->GetSystemColor( 167 colors[SELECTED][BACKGROUND] = theme->GetSystemColor(
163 ui::NativeTheme::kColorId_TextfieldSelectionBackgroundFocused); 168 ui::NativeTheme::kColorId_TextfieldSelectionBackgroundFocused);
164 colors[NORMAL][BACKGROUND] = theme->GetSystemColor( 169 colors[SELECTED][TEXT] = theme->GetSystemColor(
165 ui::NativeTheme::kColorId_TextfieldDefaultBackground); 170 ui::NativeTheme::kColorId_TextfieldSelectionColor);
166 colors[NORMAL][URL] = SkColorSetARGB(0xff, 0x00, 0x99, 0x33);
167 colors[SELECTED][URL] = SkColorSetARGB(0xff, 0x00, 0x66, 0x22); 171 colors[SELECTED][URL] = SkColorSetARGB(0xff, 0x00, 0x66, 0x22);
168 colors[HOVERED][URL] = SkColorSetARGB(0xff, 0x00, 0x66, 0x22); 172 colors[HOVERED][URL] = SkColorSetARGB(0xff, 0x00, 0x66, 0x22);
169 CommonInitColors(theme, colors); 173 CommonInitColors(theme, colors);
170 initialized = true; 174 initialized = true;
171 } 175 }
172 return colors[state][kind]; 176 return colors[state][kind];
173 } 177 }
174 178
175 void OmniboxResultView::SetMatch(const AutocompleteMatch& match) { 179 void OmniboxResultView::SetMatch(const AutocompleteMatch& match) {
176 match_ = match; 180 match_ = match;
(...skipping 440 matching lines...) Expand 10 before | Expand all | Expand 10 after
617 int x = GetMirroredXForRect(keyword_text_bounds_); 621 int x = GetMirroredXForRect(keyword_text_bounds_);
618 mirroring_context_->Initialize(x, keyword_text_bounds_.width()); 622 mirroring_context_->Initialize(x, keyword_text_bounds_.width());
619 PaintMatch(canvas, *match_.associated_keyword.get(), x); 623 PaintMatch(canvas, *match_.associated_keyword.get(), x);
620 } 624 }
621 } 625 }
622 626
623 void OmniboxResultView::AnimationProgressed(const ui::Animation* animation) { 627 void OmniboxResultView::AnimationProgressed(const ui::Animation* animation) {
624 Layout(); 628 Layout();
625 SchedulePaint(); 629 SchedulePaint();
626 } 630 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698