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

Side by Side Diff: ui/native_theme/native_theme_mac.mm

Issue 1240193002: Tweaks to make the toolkit-views HTTP Auth dialog more Maccy on MAc (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@20150720-ViewsBrowser-DisableCertificateDialog-PLUS-BORDERS
Patch Set: Created 5 years, 5 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
« no previous file with comments | « chrome/browser/ui/views/login_view.cc ('k') | ui/views/layout/layout_constants.h » ('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) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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_mac.h" 5 #include "ui/native_theme/native_theme_mac.h"
6 6
7 #import <Cocoa/Cocoa.h> 7 #import <Cocoa/Cocoa.h>
8 8
9 #include "base/basictypes.h" 9 #include "base/basictypes.h"
10 #include "base/mac/mac_util.h" 10 #include "base/mac/mac_util.h"
(...skipping 24 matching lines...) Expand all
35 // Values calculated by reading pixels and solving simultaneous equations 35 // Values calculated by reading pixels and solving simultaneous equations
36 // derived from "A over B" alpha compositing. Steps: Sample the semi-transparent 36 // derived from "A over B" alpha compositing. Steps: Sample the semi-transparent
37 // pixel over two backgrounds; P1, P2 over backgrounds B1, B2. Use the color 37 // pixel over two backgrounds; P1, P2 over backgrounds B1, B2. Use the color
38 // value between 0.0 and 1.0 (i.e. divide by 255.0). Then, 38 // value between 0.0 and 1.0 (i.e. divide by 255.0). Then,
39 // alpha = (P2 - P1 + B1 - B2) / (B1 - B2) 39 // alpha = (P2 - P1 + B1 - B2) / (B1 - B2)
40 // color = (P1 - B1 + alpha * B1) / alpha. 40 // color = (P1 - B1 + alpha * B1) / alpha.
41 const SkColor kMenuPopupBackgroundColor = SkColorSetARGB(251, 255, 255, 255); 41 const SkColor kMenuPopupBackgroundColor = SkColorSetARGB(251, 255, 255, 255);
42 const SkColor kMenuSeparatorColor = SkColorSetARGB(243, 228, 228, 228); 42 const SkColor kMenuSeparatorColor = SkColorSetARGB(243, 228, 228, 228);
43 const SkColor kMenuBorderColor = SkColorSetARGB(60, 0, 0, 0); 43 const SkColor kMenuBorderColor = SkColorSetARGB(60, 0, 0, 0);
44 44
45 // Hardcoded color used for some existing dialogs in Chrome's Cocoa UI. 45 // New "webui-style" bubbles and dialogs on Mac use a white background.
46 const SkColor kDialogBackgroundColor = SkColorSetRGB(251, 251, 251); 46 const SkColor kDialogBackgroundColor = SK_ColorWHITE;
47 47
48 // On 10.6 and 10.7 there is no way to get components from system colors. Here, 48 // On 10.6 and 10.7 there is no way to get components from system colors. Here,
49 // system colors are just opaque objects that can paint themselves and otherwise 49 // system colors are just opaque objects that can paint themselves and otherwise
50 // tell you nothing. In 10.8, some of the system color classes have incomplete 50 // tell you nothing. In 10.8, some of the system color classes have incomplete
51 // implementations and throw exceptions even attempting to convert using 51 // implementations and throw exceptions even attempting to convert using
52 // -[NSColor colorUsingColorSpace:], so don't bother there either. 52 // -[NSColor colorUsingColorSpace:], so don't bother there either.
53 // This function paints a single pixel to a 1x1 swatch and reads it back. 53 // This function paints a single pixel to a 1x1 swatch and reads it back.
54 SkColor GetSystemColorUsingSwatch(NSColor* color) { 54 SkColor GetSystemColorUsingSwatch(NSColor* color) {
55 SkColor swatch; 55 SkColor swatch;
56 base::ScopedCFTypeRef<CGColorSpaceRef> color_space( 56 base::ScopedCFTypeRef<CGColorSpaceRef> color_space(
(...skipping 306 matching lines...) Expand 10 before | Expand all | Expand 10 after
363 set_scrollbar_button_length(0); 363 set_scrollbar_button_length(0);
364 SetScrollbarColors(kScrollerThumbColor, 364 SetScrollbarColors(kScrollerThumbColor,
365 kScrollerThumbHoverColor, 365 kScrollerThumbHoverColor,
366 kScrollerTrackGradientColors[0]); 366 kScrollerTrackGradientColors[0]);
367 } 367 }
368 368
369 NativeThemeMac::~NativeThemeMac() { 369 NativeThemeMac::~NativeThemeMac() {
370 } 370 }
371 371
372 } // namespace ui 372 } // namespace ui
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/login_view.cc ('k') | ui/views/layout/layout_constants.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698