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

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

Issue 348017: Add the "Other bookmarks" button on the right of the bookmark bar.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 1 month 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 | Annotate | Revision Log
« no previous file with comments | « chrome/browser/cocoa/bookmark_bar_toolbar_view.h ('k') | no next file » | 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) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 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/cocoa/bookmark_bar_toolbar_view.h" 5 #import "chrome/browser/cocoa/bookmark_bar_toolbar_view.h"
6 6
7 #include "app/gfx/canvas_paint.h" 7 #include "app/gfx/canvas_paint.h"
8 #include "app/theme_provider.h" 8 #include "app/theme_provider.h"
9 #include "base/gfx/rect.h" 9 #include "base/gfx/rect.h"
10 #include "chrome/browser/browser_theme_provider.h" 10 #include "chrome/browser/browser_theme_provider.h"
(...skipping 18 matching lines...) Expand all
29 - (void)drawRect:(NSRect)rect { 29 - (void)drawRect:(NSRect)rect {
30 if ([controller_ drawAsFloatingBar]) { 30 if ([controller_ drawAsFloatingBar]) {
31 [self drawRectAsFloating:rect]; 31 [self drawRectAsFloating:rect];
32 } else { 32 } else {
33 NSPoint phase = [self gtm_themePatternPhase]; 33 NSPoint phase = [self gtm_themePatternPhase];
34 [[NSGraphicsContext currentContext] setPatternPhase:phase]; 34 [[NSGraphicsContext currentContext] setPatternPhase:phase];
35 [self drawBackground]; 35 [self drawBackground];
36 } 36 }
37 } 37 }
38 38
39 - (void)layoutViews {
40 if ([controller_ drawAsFloatingBar]) {
41 // The internal bookmark bar should have padding to center it.
42 NSRect frame = [self frame];
43 [buttonView_ setFrame:
44 NSMakeRect(bookmarks::kNTPBookmarkBarPadding,
45 bookmarks::kNTPBookmarkBarPadding,
46 NSWidth(frame) -
47 bookmarks::kNTPBookmarkBarPadding,
48 NSHeight(frame) -
49 bookmarks::kNTPBookmarkBarPadding)];
50 } else {
51 // The frame of our child should be equal to our frame.
52 NSRect frame = [self frame];
53 [buttonView_ setFrame:NSMakeRect(0, 0, NSWidth(frame), NSHeight(frame))];
54 }
55 }
56
57 - (void)drawRectAsFloating:(NSRect)rect { 39 - (void)drawRectAsFloating:(NSRect)rect {
58 NSRect bounds = [self bounds]; 40 NSRect bounds = [self bounds];
59 41
60 ThemeProvider* themeProvider = [controller_ themeProvider]; 42 ThemeProvider* themeProvider = [controller_ themeProvider];
61 if (!themeProvider) 43 if (!themeProvider)
62 return; 44 return;
63 45
64 NSGraphicsContext* theContext = [NSGraphicsContext currentContext]; 46 NSGraphicsContext* theContext = [NSGraphicsContext currentContext];
65 [theContext saveGraphicsState]; 47 [theContext saveGraphicsState];
66 48
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
102 NSColor* borderColor = 84 NSColor* borderColor =
103 [[self gtm_theme] strokeColorForStyle:GTMThemeStyleToolBar 85 [[self gtm_theme] strokeColorForStyle:GTMThemeStyleToolBar
104 state:GTMThemeStateActiveWindow]; 86 state:GTMThemeStateActiveWindow];
105 [borderColor set]; 87 [borderColor set];
106 [border stroke]; 88 [border stroke];
107 89
108 [theContext restoreGraphicsState]; 90 [theContext restoreGraphicsState];
109 } 91 }
110 92
111 @end // @implementation BookmarkBarToolbarView 93 @end // @implementation BookmarkBarToolbarView
OLDNEW
« no previous file with comments | « chrome/browser/cocoa/bookmark_bar_toolbar_view.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698