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

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

Issue 1438513003: [MD] Implement incognito colors as a NativeTheme (for Aura). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: init param, pkasting feedback Created 5 years, 1 month 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
« no previous file with comments | « ui/native_theme/BUILD.gn ('k') | ui/native_theme/native_theme.gyp » ('j') | 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 #include "ui/native_theme/common_theme.h" 5 #include "ui/native_theme/common_theme.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "third_party/skia/include/core/SkCanvas.h" 8 #include "third_party/skia/include/core/SkCanvas.h"
9 #include "ui/base/resource/material_design/material_design_controller.h" 9 #include "ui/base/resource/material_design/material_design_controller.h"
10 #include "ui/base/resource/resource_bundle.h" 10 #include "ui/base/resource/resource_bundle.h"
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
58 58
59 bool CommonThemeGetSystemColor(NativeTheme::ColorId color_id, SkColor* color) { 59 bool CommonThemeGetSystemColor(NativeTheme::ColorId color_id, SkColor* color) {
60 // MD colors. 60 // MD colors.
61 if (ui::MaterialDesignController::IsModeMaterial()) { 61 if (ui::MaterialDesignController::IsModeMaterial()) {
62 // MenuItem: 62 // MenuItem:
63 const SkColor kMenuHighlightBackgroundColorMd = 63 const SkColor kMenuHighlightBackgroundColorMd =
64 SkColorSetARGB(0x14, 0x00, 0x00, 0x00); 64 SkColorSetARGB(0x14, 0x00, 0x00, 0x00);
65 const SkColor kSelectedMenuItemForegroundColorMd = SK_ColorBLACK; 65 const SkColor kSelectedMenuItemForegroundColorMd = SK_ColorBLACK;
66 // Link: 66 // Link:
67 const SkColor kLinkDisabledColorMd = SK_ColorBLACK; 67 const SkColor kLinkDisabledColorMd = SK_ColorBLACK;
68 const SkColor kLinkEnabledColorMd = SkColorSetRGB(0x33, 0x67, 0xD6); 68 const SkColor kLinkEnabledColorMd = gfx::kGoogleBlue700;
69 69
70 switch (color_id) { 70 switch (color_id) {
71 // MenuItem 71 // MenuItem
72 case NativeTheme::kColorId_FocusedMenuItemBackgroundColor: 72 case NativeTheme::kColorId_FocusedMenuItemBackgroundColor:
73 *color = kMenuHighlightBackgroundColorMd; 73 *color = kMenuHighlightBackgroundColorMd;
74 return true; 74 return true;
75 case NativeTheme::kColorId_SelectedMenuItemForegroundColor: 75 case NativeTheme::kColorId_SelectedMenuItemForegroundColor:
76 *color = kSelectedMenuItemForegroundColorMd; 76 *color = kSelectedMenuItemForegroundColorMd;
77 return true; 77 return true;
78 // Link 78 // Link
(...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after
264 // static 264 // static
265 scoped_ptr<gfx::Canvas> CommonThemeCreateCanvas(SkCanvas* sk_canvas) { 265 scoped_ptr<gfx::Canvas> CommonThemeCreateCanvas(SkCanvas* sk_canvas) {
266 // TODO(pkotwicz): Do something better and don't infer device 266 // TODO(pkotwicz): Do something better and don't infer device
267 // scale factor from canvas scale. 267 // scale factor from canvas scale.
268 SkMatrix m = sk_canvas->getTotalMatrix(); 268 SkMatrix m = sk_canvas->getTotalMatrix();
269 float device_scale = static_cast<float>(SkScalarAbs(m.getScaleX())); 269 float device_scale = static_cast<float>(SkScalarAbs(m.getScaleX()));
270 return make_scoped_ptr(new gfx::Canvas(sk_canvas, device_scale)); 270 return make_scoped_ptr(new gfx::Canvas(sk_canvas, device_scale));
271 } 271 }
272 272
273 } // namespace ui 273 } // namespace ui
OLDNEW
« no previous file with comments | « ui/native_theme/BUILD.gn ('k') | ui/native_theme/native_theme.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698