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

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

Issue 795933009: [AiS] for desktop, two lines and font sytles (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Removed old function declaration; fixed reference to color macros Created 5 years, 9 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 "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>
11 11
12 #include "base/basictypes.h" 12 #include "base/basictypes.h"
13 #include "base/logging.h" 13 #include "base/logging.h"
14 #include "base/memory/scoped_ptr.h" 14 #include "base/memory/scoped_ptr.h"
15 #include "base/win/scoped_gdi_object.h" 15 #include "base/win/scoped_gdi_object.h"
16 #include "base/win/scoped_hdc.h" 16 #include "base/win/scoped_hdc.h"
17 #include "base/win/scoped_select_object.h" 17 #include "base/win/scoped_select_object.h"
18 #include "base/win/windows_version.h" 18 #include "base/win/windows_version.h"
19 #include "skia/ext/bitmap_platform_device.h" 19 #include "skia/ext/bitmap_platform_device.h"
20 #include "skia/ext/platform_canvas.h" 20 #include "skia/ext/platform_canvas.h"
21 #include "skia/ext/skia_utils_win.h" 21 #include "skia/ext/skia_utils_win.h"
22 #include "third_party/skia/include/core/SkCanvas.h" 22 #include "third_party/skia/include/core/SkCanvas.h"
23 #include "third_party/skia/include/core/SkColor.h"
23 #include "third_party/skia/include/core/SkColorPriv.h" 24 #include "third_party/skia/include/core/SkColorPriv.h"
24 #include "third_party/skia/include/core/SkShader.h" 25 #include "third_party/skia/include/core/SkShader.h"
25 #include "ui/gfx/color_utils.h" 26 #include "ui/gfx/color_utils.h"
26 #include "ui/gfx/gdi_util.h" 27 #include "ui/gfx/gdi_util.h"
27 #include "ui/gfx/geometry/rect.h" 28 #include "ui/gfx/geometry/rect.h"
28 #include "ui/gfx/geometry/rect_conversions.h" 29 #include "ui/gfx/geometry/rect_conversions.h"
29 #include "ui/gfx/win/dpi.h" 30 #include "ui/gfx/win/dpi.h"
30 #include "ui/native_theme/common_theme.h" 31 #include "ui/native_theme/common_theme.h"
31 32
32 // This was removed from Winvers.h but is still used. 33 // This was removed from Winvers.h but is still used.
(...skipping 567 matching lines...) Expand 10 before | Expand all | Expand 10 after
600 601
601 // Results Tables 602 // Results Tables
602 case kColorId_ResultsTableNormalBackground: 603 case kColorId_ResultsTableNormalBackground:
603 return system_colors_[COLOR_WINDOW]; 604 return system_colors_[COLOR_WINDOW];
604 case kColorId_ResultsTableHoveredBackground: 605 case kColorId_ResultsTableHoveredBackground:
605 return color_utils::AlphaBlend(system_colors_[COLOR_HIGHLIGHT], 606 return color_utils::AlphaBlend(system_colors_[COLOR_HIGHLIGHT],
606 system_colors_[COLOR_WINDOW], 0x40); 607 system_colors_[COLOR_WINDOW], 0x40);
607 case kColorId_ResultsTableSelectedBackground: 608 case kColorId_ResultsTableSelectedBackground:
608 return system_colors_[COLOR_HIGHLIGHT]; 609 return system_colors_[COLOR_HIGHLIGHT];
609 case kColorId_ResultsTableNormalText: 610 case kColorId_ResultsTableNormalText:
611 return system_colors_[COLOR_WINDOWTEXT];
610 case kColorId_ResultsTableHoveredText: 612 case kColorId_ResultsTableHoveredText:
611 return system_colors_[COLOR_WINDOWTEXT]; 613 return color_utils::GetReadableColor(
msw 2015/03/18 18:03:37 Should the other kColorId_ResultsTable*Text (Norma
dschuyler 2015/03/18 19:16:49 I'm not sure on that. Either way, I'd prefer to a
msw 2015/03/18 20:20:16 I'd assume that these colors should be consistent
Peter Kasting 2015/03/18 22:19:33 I disagree with all of this :) First, it would be
msw 2015/03/19 21:19:56 Okay, that's actually reasonable.
614 system_colors_[COLOR_WINDOWTEXT],
615 GetSystemColor(kColorId_ResultsTableHoveredBackground));
612 case kColorId_ResultsTableSelectedText: 616 case kColorId_ResultsTableSelectedText:
613 return system_colors_[COLOR_HIGHLIGHTTEXT]; 617 return system_colors_[COLOR_HIGHLIGHTTEXT];
614 case kColorId_ResultsTableNormalDimmedText: 618 case kColorId_ResultsTableNormalDimmedText:
615 return color_utils::AlphaBlend(system_colors_[COLOR_WINDOWTEXT], 619 return color_utils::AlphaBlend(system_colors_[COLOR_WINDOWTEXT],
616 system_colors_[COLOR_WINDOW], 0x80); 620 system_colors_[COLOR_WINDOW], 0x80);
617 case kColorId_ResultsTableHoveredDimmedText: 621 case kColorId_ResultsTableHoveredDimmedText:
618 return color_utils::AlphaBlend( 622 return color_utils::AlphaBlend(
619 system_colors_[COLOR_WINDOWTEXT], 623 system_colors_[COLOR_WINDOWTEXT],
620 GetSystemColor(kColorId_ResultsTableHoveredBackground), 0x80); 624 GetSystemColor(kColorId_ResultsTableHoveredBackground), 0x80);
621 case kColorId_ResultsTableSelectedDimmedText: 625 case kColorId_ResultsTableSelectedDimmedText:
(...skipping 12 matching lines...) Expand all
634 case kColorId_ResultsTableNormalDivider: 638 case kColorId_ResultsTableNormalDivider:
635 return color_utils::AlphaBlend(system_colors_[COLOR_WINDOWTEXT], 639 return color_utils::AlphaBlend(system_colors_[COLOR_WINDOWTEXT],
636 system_colors_[COLOR_WINDOW], 0x34); 640 system_colors_[COLOR_WINDOW], 0x34);
637 case kColorId_ResultsTableHoveredDivider: 641 case kColorId_ResultsTableHoveredDivider:
638 return color_utils::AlphaBlend( 642 return color_utils::AlphaBlend(
639 system_colors_[COLOR_WINDOWTEXT], 643 system_colors_[COLOR_WINDOWTEXT],
640 GetSystemColor(kColorId_ResultsTableHoveredBackground), 0x34); 644 GetSystemColor(kColorId_ResultsTableHoveredBackground), 0x34);
641 case kColorId_ResultsTableSelectedDivider: 645 case kColorId_ResultsTableSelectedDivider:
642 return color_utils::AlphaBlend(system_colors_[COLOR_HIGHLIGHTTEXT], 646 return color_utils::AlphaBlend(system_colors_[COLOR_HIGHLIGHTTEXT],
643 system_colors_[COLOR_HIGHLIGHT], 0x34); 647 system_colors_[COLOR_HIGHLIGHT], 0x34);
648 case kColorId_ResultsTablePositiveText:
649 return color_utils::GetReadableColor(SK_ColorGREEN,
msw 2015/03/18 18:03:37 ditto nits about red/green locale values and file-
dschuyler 2015/03/18 19:16:49 Acknowledged.
650 system_colors_[COLOR_WINDOW]);
651 case kColorId_ResultsTablePositiveHoveredText:
652 return color_utils::GetReadableColor(
653 SK_ColorGREEN,
654 GetSystemColor(kColorId_ResultsTableHoveredBackground));
655 case kColorId_ResultsTablePositiveSelectedText:
656 return color_utils::GetReadableColor(SK_ColorGREEN,
657 system_colors_[COLOR_HIGHLIGHT]);
658 case kColorId_ResultsTableNegativeText:
659 return color_utils::GetReadableColor(SK_ColorRED,
660 system_colors_[COLOR_WINDOW]);
661 case kColorId_ResultsTableNegativeHoveredText:
662 return color_utils::GetReadableColor(
663 SK_ColorRED, GetSystemColor(kColorId_ResultsTableHoveredBackground));
664 case kColorId_ResultsTableNegativeSelectedText:
665 return color_utils::GetReadableColor(SK_ColorRED,
666 system_colors_[COLOR_HIGHLIGHT]);
644 } 667 }
645 NOTREACHED(); 668 NOTREACHED();
646 return kInvalidColorIdColor; 669 return kInvalidColorIdColor;
647 } 670 }
648 671
649 void NativeThemeWin::PaintIndirect(SkCanvas* canvas, 672 void NativeThemeWin::PaintIndirect(SkCanvas* canvas,
650 Part part, 673 Part part,
651 State state, 674 State state,
652 const gfx::Rect& rect, 675 const gfx::Rect& rect,
653 const ExtraParams& extra) const { 676 const ExtraParams& extra) const {
(...skipping 1405 matching lines...) Expand 10 before | Expand all | Expand 10 after
2059 break; 2082 break;
2060 case LAST: 2083 case LAST:
2061 NOTREACHED(); 2084 NOTREACHED();
2062 break; 2085 break;
2063 } 2086 }
2064 theme_handles_[theme_name] = handle; 2087 theme_handles_[theme_name] = handle;
2065 return handle; 2088 return handle;
2066 } 2089 }
2067 2090
2068 } // namespace ui 2091 } // namespace ui
OLDNEW
« ui/native_theme/fallback_theme.cc ('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