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

Unified Diff: chrome/browser/ui/views/location_bar/location_bar_view.cc

Issue 11421204: Use native theme colors for textfields; etc. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Sync and rebase, add a blank line between includes. Created 8 years 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/ui/views/frame/browser_view.h ('k') | chrome/browser/ui/views/omnibox/omnibox_view_views.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/views/location_bar/location_bar_view.cc
diff --git a/chrome/browser/ui/views/location_bar/location_bar_view.cc b/chrome/browser/ui/views/location_bar/location_bar_view.cc
index ee59f1810df80d6c187de363f216dcd40eb08c02..7f73c710b61951dd1b2cc5a5055ae4bf2078e5e1 100644
--- a/chrome/browser/ui/views/location_bar/location_bar_view.cc
+++ b/chrome/browser/ui/views/location_bar/location_bar_view.cc
@@ -120,12 +120,6 @@ const int kDesktopScriptBadgeEdgeItemPadding = kDesktopScriptBadgeItemPadding;
const int kTouchItemPadding = 8;
const int kTouchEdgeItemPadding = kTouchItemPadding;
-#if defined(OS_CHROMEOS)
-const SkColor kOmniboxBackgroundColor = SkColorSetARGB(0, 255, 255, 255);
-#else
-const SkColor kOmniboxBackgroundColor = SkColorSetARGB(255, 255, 255, 255);
-#endif
-
} // namespace
// static
@@ -332,26 +326,24 @@ bool LocationBarView::IsInitialized() const {
SkColor LocationBarView::GetColor(ToolbarModel::SecurityLevel security_level,
ColorKind kind) const {
-#if defined(OS_WIN)
- if (GetNativeTheme() == ui::NativeThemeWin::instance()) {
- switch (kind) {
- case BACKGROUND:
- return color_utils::GetSysSkColor(COLOR_WINDOW);
- case TEXT:
- return color_utils::GetSysSkColor(COLOR_WINDOWTEXT);
- case SELECTED_TEXT:
- return color_utils::GetSysSkColor(COLOR_HIGHLIGHTTEXT);
- default:
- // Other cases are handled below.
- break;
- }
- }
-#endif
+ const ui::NativeTheme* native_theme = GetNativeTheme();
switch (kind) {
- // TODO(beng): source from theme provider.
- case BACKGROUND: return kOmniboxBackgroundColor;
- case TEXT: return SK_ColorBLACK;
- case SELECTED_TEXT: return SK_ColorWHITE;
+ case BACKGROUND:
+#if defined(OS_CHROMEOS)
+ // Chrome OS requires a transparent omnibox background color.
+ return SkColorSetARGB(0, 255, 255, 255);
+#else
+ return native_theme->GetSystemColor(
+ ui::NativeTheme::kColorId_TextfieldDefaultBackground);
+#endif
+
+ case TEXT:
+ return native_theme->GetSystemColor(
+ ui::NativeTheme::kColorId_TextfieldDefaultColor);
+
+ case SELECTED_TEXT:
+ return native_theme->GetSystemColor(
+ ui::NativeTheme::kColorId_TextfieldSelectionColor);
case DEEMPHASIZED_TEXT:
return color_utils::AlphaBlend(
« no previous file with comments | « chrome/browser/ui/views/frame/browser_view.h ('k') | chrome/browser/ui/views/omnibox/omnibox_view_views.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698