OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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_folder_window.h" | 5 #import "chrome/browser/ui/cocoa/bookmarks/bookmark_bar_folder_window.h" |
6 | 6 |
7 #import "base/logging.h" | 7 #import "base/logging.h" |
8 #include "base/nsimage_cache_mac.h" | 8 #include "app/mac/nsimage_cache.h" |
9 #import "base/scoped_nsobject.h" | 9 #import "base/scoped_nsobject.h" |
10 #import "chrome/browser/ui/cocoa/bookmarks/bookmark_bar_folder_controller.h" | 10 #import "chrome/browser/ui/cocoa/bookmarks/bookmark_bar_folder_controller.h" |
11 #import "chrome/browser/ui/cocoa/image_utils.h" | 11 #import "chrome/browser/ui/cocoa/image_utils.h" |
12 #import "third_party/GTM/AppKit/GTMNSColor+Luminance.h" | 12 #import "third_party/GTM/AppKit/GTMNSColor+Luminance.h" |
13 #import "third_party/GTM/AppKit/GTMNSBezierPath+RoundRect.h" | 13 #import "third_party/GTM/AppKit/GTMNSBezierPath+RoundRect.h" |
14 | 14 |
15 | 15 |
16 @implementation BookmarkBarFolderWindow | 16 @implementation BookmarkBarFolderWindow |
17 | 17 |
18 - (id)initWithContentRect:(NSRect)contentRect | 18 - (id)initWithContentRect:(NSRect)contentRect |
(...skipping 15 matching lines...) Expand all Loading... |
34 | 34 |
35 namespace { | 35 namespace { |
36 // Corner radius for our bookmark bar folder window. | 36 // Corner radius for our bookmark bar folder window. |
37 // Copied from bubble_view.mm. | 37 // Copied from bubble_view.mm. |
38 const CGFloat kViewCornerRadius = 4.0; | 38 const CGFloat kViewCornerRadius = 4.0; |
39 } | 39 } |
40 | 40 |
41 @implementation BookmarkBarFolderWindowContentView | 41 @implementation BookmarkBarFolderWindowContentView |
42 | 42 |
43 - (void)awakeFromNib { | 43 - (void)awakeFromNib { |
44 arrowUpImage_.reset([nsimage_cache::ImageNamed(@"menu_overflow_up.pdf") | 44 arrowUpImage_.reset( |
45 retain]); | 45 [app::mac::GetCachedImageWithName(@"menu_overflow_up.pdf") retain]); |
46 arrowDownImage_.reset([nsimage_cache::ImageNamed(@"menu_overflow_down.pdf") | 46 arrowDownImage_.reset( |
47 retain]); | 47 [app::mac::GetCachedImageWithName(@"menu_overflow_down.pdf") retain]); |
48 } | 48 } |
49 | 49 |
50 // Draw the arrows at the top and bottom of the folder window as a | 50 // Draw the arrows at the top and bottom of the folder window as a |
51 // visual indication that scrolling is possible. We always draw the | 51 // visual indication that scrolling is possible. We always draw the |
52 // scrolling arrows; when not relevant (e.g. when not scrollable), the | 52 // scrolling arrows; when not relevant (e.g. when not scrollable), the |
53 // scroll view overlaps the window and the arrows aren't visible. | 53 // scroll view overlaps the window and the arrows aren't visible. |
54 - (void)drawScrollArrows:(NSRect)rect { | 54 - (void)drawScrollArrows:(NSRect)rect { |
55 NSRect visibleRect = [self bounds]; | 55 NSRect visibleRect = [self bounds]; |
56 | 56 |
57 // On top | 57 // On top |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
127 // window. However that also allows some scrollWheel: events to leak | 127 // window. However that also allows some scrollWheel: events to leak |
128 // into the NSWindow behind it (even in a different application). | 128 // into the NSWindow behind it (even in a different application). |
129 // Better to plug the scroll leak than to round corners for M5. | 129 // Better to plug the scroll leak than to round corners for M5. |
130 - (void)scrollWheel:(NSEvent *)theEvent { | 130 - (void)scrollWheel:(NSEvent *)theEvent { |
131 DCHECK([[[self window] windowController] | 131 DCHECK([[[self window] windowController] |
132 respondsToSelector:@selector(scrollWheel:)]); | 132 respondsToSelector:@selector(scrollWheel:)]); |
133 [[[self window] windowController] scrollWheel:theEvent]; | 133 [[[self window] windowController] scrollWheel:theEvent]; |
134 } | 134 } |
135 | 135 |
136 @end | 136 @end |
OLD | NEW |