| 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" |
| 11 #import "chrome/browser/ui/cocoa/bookmarks/bookmark_bar_controller.h" | 11 #import "chrome/browser/ui/cocoa/bookmarks/bookmark_bar_controller.h" |
| 12 #import "chrome/browser/ui/cocoa/browser_window_controller.h" | 12 #import "chrome/browser/ui/cocoa/browser_window_controller.h" |
| 13 #include "skia/ext/skia_utils_mac.h" | 13 #include "skia/ext/skia_utils_mac.h" |
| 14 #import "ui/base/cocoa/nsview_additions.h" | 14 #import "ui/base/cocoa/nsview_additions.h" |
| 15 #include "ui/base/theme_provider.h" | 15 #include "ui/base/theme_provider.h" |
| 16 #include "ui/gfx/canvas_skia_paint.h" | 16 #include "ui/gfx/canvas_skia_paint.h" |
| 17 #include "ui/gfx/geometry/rect.h" | 17 #include "ui/gfx/geometry/rect.h" |
| 18 #include "ui/gfx/scoped_ns_graphics_context_save_gstate_mac.h" | 18 #include "ui/gfx/scoped_ns_graphics_context_save_gstate_mac.h" |
| 19 | 19 |
| 20 @interface BookmarkBarToolbarView (Private) | 20 @interface BookmarkBarToolbarView (Private) |
| 21 - (void)drawAsDetachedBubble:(NSRect)dirtyRect; | 21 - (void)drawAsDetachedBubble:(NSRect)dirtyRect; |
| 22 @end | 22 @end |
| 23 | 23 |
| 24 @implementation BookmarkBarToolbarView | 24 @implementation BookmarkBarToolbarView |
| 25 | 25 |
| 26 - (void)setController:(id<BookmarkBarToolbarViewController>)controller { |
| 27 controller_ = controller; |
| 28 } |
| 29 |
| 26 - (BOOL)isOpaque { | 30 - (BOOL)isOpaque { |
| 27 // -drawRect: calls -drawAsDetachedBubble: or -drawBackground:, both of which | 31 // -drawRect: calls -drawAsDetachedBubble: or -drawBackground:, both of which |
| 28 // fill the dirty rect with an opaque color. | 32 // fill the dirty rect with an opaque color. |
| 29 return YES; | 33 return YES; |
| 30 } | 34 } |
| 31 | 35 |
| 32 - (void)resetCursorRects { | 36 - (void)resetCursorRects { |
| 33 NSCursor *arrow = [NSCursor arrowCursor]; | 37 NSCursor *arrow = [NSCursor arrowCursor]; |
| 34 [self addCursorRect:[self visibleRect] cursor:arrow]; | 38 [self addCursorRect:[self visibleRect] cursor:arrow]; |
| 35 [arrow setOnMouseEntered:YES]; | 39 [arrow setOnMouseEntered:YES]; |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 83 strokeColor = [[self strokeColor] blendedColorWithFraction:morph | 87 strokeColor = [[self strokeColor] blendedColorWithFraction:morph |
| 84 ofColor:strokeColor]; | 88 ofColor:strokeColor]; |
| 85 strokeColor = [strokeColor colorWithAlphaComponent:0.5]; | 89 strokeColor = [strokeColor colorWithAlphaComponent:0.5]; |
| 86 [strokeColor set]; | 90 [strokeColor set]; |
| 87 NSRectFillUsingOperation(NSIntersectionRect(strokeRect, dirtyRect), | 91 NSRectFillUsingOperation(NSIntersectionRect(strokeRect, dirtyRect), |
| 88 NSCompositeSourceOver); | 92 NSCompositeSourceOver); |
| 89 } | 93 } |
| 90 } | 94 } |
| 91 | 95 |
| 92 @end // @implementation BookmarkBarToolbarView | 96 @end // @implementation BookmarkBarToolbarView |
| OLD | NEW |