OLD | NEW |
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 Loading... |
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 = | 60 NSColor* toolbarColor = tp.GetNSColor(ThemeProperties::COLOR_NTP_BACKGROUND); |
61 tp.GetNSColor(ThemeProperties::COLOR_DETACHED_BOOKMARK_BAR_BACKGROUND); | |
62 CGFloat alpha = morph * [toolbarColor alphaComponent]; | 61 CGFloat alpha = morph * [toolbarColor alphaComponent]; |
63 [[toolbarColor colorWithAlphaComponent:alpha] set]; | 62 [[toolbarColor colorWithAlphaComponent:alpha] set]; |
64 NSRectFillUsingOperation(dirtyRect, NSCompositeSourceOver); | 63 NSRectFillUsingOperation(dirtyRect, NSCompositeSourceOver); |
65 | 64 |
66 // Fade in/out the background. | 65 // Fade in/out the background. |
67 { | 66 { |
68 gfx::ScopedNSGraphicsContextSaveGState bgScopedState; | 67 gfx::ScopedNSGraphicsContextSaveGState bgScopedState; |
69 NSGraphicsContext* context = [NSGraphicsContext currentContext]; | 68 NSGraphicsContext* context = [NSGraphicsContext currentContext]; |
70 CGContextRef cgContext = static_cast<CGContextRef>([context graphicsPort]); | 69 CGContextRef cgContext = static_cast<CGContextRef>([context graphicsPort]); |
71 CGContextSetAlpha(cgContext, 1 - morph); | 70 CGContextSetAlpha(cgContext, 1 - morph); |
(...skipping 11 matching lines...) Expand all Loading... |
83 strokeColor = [[self strokeColor] blendedColorWithFraction:morph | 82 strokeColor = [[self strokeColor] blendedColorWithFraction:morph |
84 ofColor:strokeColor]; | 83 ofColor:strokeColor]; |
85 strokeColor = [strokeColor colorWithAlphaComponent:0.5]; | 84 strokeColor = [strokeColor colorWithAlphaComponent:0.5]; |
86 [strokeColor set]; | 85 [strokeColor set]; |
87 NSRectFillUsingOperation(NSIntersectionRect(strokeRect, dirtyRect), | 86 NSRectFillUsingOperation(NSIntersectionRect(strokeRect, dirtyRect), |
88 NSCompositeSourceOver); | 87 NSCompositeSourceOver); |
89 } | 88 } |
90 } | 89 } |
91 | 90 |
92 @end // @implementation BookmarkBarToolbarView | 91 @end // @implementation BookmarkBarToolbarView |
OLD | NEW |