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

Side by Side Diff: chrome/browser/ui/cocoa/bookmarks/bookmark_bar_toolbar_view.mm

Issue 2159833002: Revert of Replace CONTROL_BACKGROUND and DETACHED_BOOKMARK_BAR_BACKGROUND by COLOR_NTP_BACKGROUND (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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/chrome_style.cc ('k') | chrome/browser/ui/libgtk2ui/gtk2_ui.cc » ('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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 #import "chrome/browser/ui/cocoa/bookmarks/bookmark_bar_toolbar_view.h" 5 #import "chrome/browser/ui/cocoa/bookmarks/bookmark_bar_toolbar_view.h"
6 6
7 #include "chrome/browser/search/search.h" 7 #include "chrome/browser/search/search.h"
8 #include "chrome/browser/themes/theme_properties.h" 8 #include "chrome/browser/themes/theme_properties.h"
9 #include "chrome/browser/themes/theme_service.h" 9 #include "chrome/browser/themes/theme_service.h"
10 #import "chrome/browser/ui/cocoa/bookmarks/bookmark_bar_constants.h" 10 #import "chrome/browser/ui/cocoa/bookmarks/bookmark_bar_constants.h"
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
50 Profile* profile = [controller_ profile]; 50 Profile* profile = [controller_ profile];
51 if (!profile) 51 if (!profile)
52 return; 52 return;
53 53
54 [[NSColor whiteColor] set]; 54 [[NSColor whiteColor] set];
55 NSRectFill(dirtyRect); 55 NSRectFill(dirtyRect);
56 56
57 // Overlay with a lighter background color. 57 // Overlay with a lighter background color.
58 const ui::ThemeProvider& tp = 58 const ui::ThemeProvider& tp =
59 ThemeService::GetThemeProviderForProfile(profile); 59 ThemeService::GetThemeProviderForProfile(profile);
60 NSColor* toolbarColor = tp.GetNSColor(ThemeProperties::COLOR_NTP_BACKGROUND); 60 NSColor* toolbarColor =
61 tp.GetNSColor(ThemeProperties::COLOR_DETACHED_BOOKMARK_BAR_BACKGROUND);
61 CGFloat alpha = morph * [toolbarColor alphaComponent]; 62 CGFloat alpha = morph * [toolbarColor alphaComponent];
62 [[toolbarColor colorWithAlphaComponent:alpha] set]; 63 [[toolbarColor colorWithAlphaComponent:alpha] set];
63 NSRectFillUsingOperation(dirtyRect, NSCompositeSourceOver); 64 NSRectFillUsingOperation(dirtyRect, NSCompositeSourceOver);
64 65
65 // Fade in/out the background. 66 // Fade in/out the background.
66 { 67 {
67 gfx::ScopedNSGraphicsContextSaveGState bgScopedState; 68 gfx::ScopedNSGraphicsContextSaveGState bgScopedState;
68 NSGraphicsContext* context = [NSGraphicsContext currentContext]; 69 NSGraphicsContext* context = [NSGraphicsContext currentContext];
69 CGContextRef cgContext = static_cast<CGContextRef>([context graphicsPort]); 70 CGContextRef cgContext = static_cast<CGContextRef>([context graphicsPort]);
70 CGContextSetAlpha(cgContext, 1 - morph); 71 CGContextSetAlpha(cgContext, 1 - morph);
(...skipping 11 matching lines...) Expand all
82 strokeColor = [[self strokeColor] blendedColorWithFraction:morph 83 strokeColor = [[self strokeColor] blendedColorWithFraction:morph
83 ofColor:strokeColor]; 84 ofColor:strokeColor];
84 strokeColor = [strokeColor colorWithAlphaComponent:0.5]; 85 strokeColor = [strokeColor colorWithAlphaComponent:0.5];
85 [strokeColor set]; 86 [strokeColor set];
86 NSRectFillUsingOperation(NSIntersectionRect(strokeRect, dirtyRect), 87 NSRectFillUsingOperation(NSIntersectionRect(strokeRect, dirtyRect),
87 NSCompositeSourceOver); 88 NSCompositeSourceOver);
88 } 89 }
89 } 90 }
90 91
91 @end // @implementation BookmarkBarToolbarView 92 @end // @implementation BookmarkBarToolbarView
OLDNEW
« no previous file with comments | « chrome/browser/ui/chrome_style.cc ('k') | chrome/browser/ui/libgtk2ui/gtk2_ui.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698