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

Side by Side Diff: ui/native_theme/native_theme_win.cc

Issue 222613005: views: Fix linux omnibox colors by refactoring omnibox_result_view.cc. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix indentation on the table. Created 6 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
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 "ui/native_theme/native_theme_win.h" 5 #include "ui/native_theme/native_theme_win.h"
6 6
7 #include <windows.h> 7 #include <windows.h>
8 #include <uxtheme.h> 8 #include <uxtheme.h>
9 #include <vsstyle.h> 9 #include <vsstyle.h>
10 #include <vssym32.h> 10 #include <vssym32.h>
(...skipping 584 matching lines...) Expand 10 before | Expand all | Expand 10 after
595 case kColorId_TableSelectedTextUnfocused: 595 case kColorId_TableSelectedTextUnfocused:
596 return system_colors_[COLOR_BTNTEXT]; 596 return system_colors_[COLOR_BTNTEXT];
597 case kColorId_TableSelectionBackgroundFocused: 597 case kColorId_TableSelectionBackgroundFocused:
598 return system_colors_[COLOR_HIGHLIGHT]; 598 return system_colors_[COLOR_HIGHLIGHT];
599 case kColorId_TableSelectionBackgroundUnfocused: 599 case kColorId_TableSelectionBackgroundUnfocused:
600 return system_colors_[IsUsingHighContrastTheme() ? 600 return system_colors_[IsUsingHighContrastTheme() ?
601 COLOR_MENUHIGHLIGHT : COLOR_BTNFACE]; 601 COLOR_MENUHIGHLIGHT : COLOR_BTNFACE];
602 case kColorId_TableGroupingIndicatorColor: 602 case kColorId_TableGroupingIndicatorColor:
603 return system_colors_[COLOR_GRAYTEXT]; 603 return system_colors_[COLOR_GRAYTEXT];
604 604
605 // Results Tables
606 case kColorId_ResultsTableNormalBackground:
607 return system_colors_[COLOR_WINDOW];
608 case kColorId_ResultsTableHoveredBackground:
609 return color_utils::AlphaBlend(system_colors_[COLOR_HIGHLIGHT],
msw 2014/04/03 18:53:53 Can we merge any blending code/rules across native
Elliot Glaysher 2014/04/03 20:25:27 Not easily. The common_theme.h stuff is set up to
msw 2014/04/03 20:30:25 I guess I was wondering if the NativeTheme could j
610 system_colors_[COLOR_WINDOW], 64);
611 case kColorId_ResultsTableSelectedBackground:
612 return system_colors_[COLOR_HIGHLIGHT];
613 case kColorId_ResultsTableNormalText:
614 case kColorId_ResultsTableHoveredText:
615 return system_colors_[COLOR_WINDOWTEXT];
616 case kColorId_ResultsTableSelectedText:
617 return system_colors_[COLOR_HIGHLIGHTTEXT];
618 case kColorId_ResultsTableNormalDimmedText:
619 return color_utils::AlphaBlend(system_colors_[COLOR_WINDOWTEXT],
620 system_colors_[COLOR_WINDOW], 128);
621 case kColorId_ResultsTableHoveredDimmedText:
622 return color_utils::AlphaBlend(
623 system_colors_[COLOR_WINDOWTEXT],
624 GetSystemColor(kColorId_ResultsTableHoveredBackground), 128);
625 case kColorId_ResultsTableSelectedDimmedText:
626 return color_utils::AlphaBlend(system_colors_[COLOR_HIGHLIGHTTEXT],
627 system_colors_[COLOR_HIGHLIGHT], 128);
628 case kColorId_ResultsTableNormalUrl:
629 return color_utils::GetReadableColor(SkColorSetRGB(0, 128, 0),
630 system_colors_[COLOR_WINDOW]);
631 case kColorId_ResultsTableHoveredUrl:
632 return color_utils::GetReadableColor(
633 SkColorSetRGB(0, 128, 0),
634 GetSystemColor(kColorId_ResultsTableHoveredBackground));
635 case kColorId_ResultsTableSelectedUrl:
636 return color_utils::GetReadableColor(SkColorSetRGB(0, 128, 0),
637 system_colors_[COLOR_HIGHLIGHT]);
638 case kColorId_ResultsTableNormalDivider:
639 return color_utils::AlphaBlend(system_colors_[COLOR_WINDOWTEXT],
640 system_colors_[COLOR_WINDOW], 0x34);
msw 2014/04/03 18:53:53 nit: consistency in hex/decimal blending values wo
Elliot Glaysher 2014/04/03 20:25:27 Done in all the NativeTheme instances.
641 case kColorId_ResultsTableHoveredDivider:
642 return color_utils::AlphaBlend(
643 system_colors_[COLOR_WINDOWTEXT],
644 GetSystemColor(kColorId_ResultsTableHoveredBackground), 0x34);
645 case kColorId_ResultsTableSelectedDivider:
646 return color_utils::AlphaBlend(system_colors_[COLOR_HIGHLIGHTTEXT],
647 system_colors_[COLOR_HIGHLIGHT], 0x34);
605 default: 648 default:
606 NOTREACHED(); 649 NOTREACHED();
607 break; 650 break;
608 } 651 }
609 return kInvalidColorIdColor; 652 return kInvalidColorIdColor;
610 } 653 }
611 654
612 void NativeThemeWin::PaintIndirect(SkCanvas* canvas, 655 void NativeThemeWin::PaintIndirect(SkCanvas* canvas,
613 Part part, 656 Part part,
614 State state, 657 State state,
(...skipping 1491 matching lines...) Expand 10 before | Expand all | Expand 10 after
2106 handle = open_theme_(NULL, L"Spin"); 2149 handle = open_theme_(NULL, L"Spin");
2107 break; 2150 break;
2108 default: 2151 default:
2109 NOTREACHED(); 2152 NOTREACHED();
2110 } 2153 }
2111 theme_handles_[theme_name] = handle; 2154 theme_handles_[theme_name] = handle;
2112 return handle; 2155 return handle;
2113 } 2156 }
2114 2157
2115 } // namespace ui 2158 } // namespace ui
OLDNEW
« ui/native_theme/native_theme.h ('K') | « ui/native_theme/native_theme.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698