OLD | NEW |
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 338 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
349 } | 349 } |
350 } | 350 } |
351 | 351 |
352 void NativeThemeWin::OnSysColorChange() { | 352 void NativeThemeWin::OnSysColorChange() { |
353 UpdateSystemColors(); | 353 UpdateSystemColors(); |
354 is_using_high_contrast_valid_ = false; | 354 is_using_high_contrast_valid_ = false; |
355 NotifyObservers(); | 355 NotifyObservers(); |
356 } | 356 } |
357 | 357 |
358 void NativeThemeWin::UpdateSystemColors() { | 358 void NativeThemeWin::UpdateSystemColors() { |
359 for (int i = 0; i < arraysize(kSystemColors); ++i) { | 359 for (int kSystemColor : kSystemColors) |
360 system_colors_[kSystemColors[i]] = | 360 system_colors_[kSystemColor] = color_utils::GetSysSkColor(kSystemColor); |
361 color_utils::GetSysSkColor(kSystemColors[i]); | |
362 } | |
363 } | 361 } |
364 | 362 |
365 void NativeThemeWin::PaintDirect(SkCanvas* canvas, | 363 void NativeThemeWin::PaintDirect(SkCanvas* canvas, |
366 Part part, | 364 Part part, |
367 State state, | 365 State state, |
368 const gfx::Rect& rect, | 366 const gfx::Rect& rect, |
369 const ExtraParams& extra) const { | 367 const ExtraParams& extra) const { |
370 skia::ScopedPlatformPaint scoped_platform_paint(canvas); | 368 skia::ScopedPlatformPaint scoped_platform_paint(canvas); |
371 HDC hdc = scoped_platform_paint.GetPlatformSurface(); | 369 HDC hdc = scoped_platform_paint.GetPlatformSurface(); |
372 | 370 |
(...skipping 1692 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2065 break; | 2063 break; |
2066 case LAST: | 2064 case LAST: |
2067 NOTREACHED(); | 2065 NOTREACHED(); |
2068 break; | 2066 break; |
2069 } | 2067 } |
2070 theme_handles_[theme_name] = handle; | 2068 theme_handles_[theme_name] = handle; |
2071 return handle; | 2069 return handle; |
2072 } | 2070 } |
2073 | 2071 |
2074 } // namespace ui | 2072 } // namespace ui |
OLD | NEW |