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 = 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 Loading... |
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 |
OLD | NEW |