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/location_bar/location_bar_decoration.h" | 5 #import "chrome/browser/ui/cocoa/location_bar/location_bar_decoration.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "base/mac/scoped_nsobject.h" | 8 #include "base/mac/scoped_nsobject.h" |
9 #include "chrome/browser/ui/cocoa/omnibox/omnibox_view_mac.h" | 9 #include "chrome/browser/ui/cocoa/omnibox/omnibox_view_mac.h" |
10 #include "ui/gfx/font.h" | 10 #include "ui/gfx/font.h" |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
62 | 62 |
63 bool LocationBarDecoration::OnMousePressed(NSRect frame, NSPoint location) { | 63 bool LocationBarDecoration::OnMousePressed(NSRect frame, NSPoint location) { |
64 return false; | 64 return false; |
65 } | 65 } |
66 | 66 |
67 NSMenu* LocationBarDecoration::GetMenu() { | 67 NSMenu* LocationBarDecoration::GetMenu() { |
68 return nil; | 68 return nil; |
69 } | 69 } |
70 | 70 |
71 NSFont* LocationBarDecoration::GetFont() const { | 71 NSFont* LocationBarDecoration::GetFont() const { |
72 return OmniboxViewMac::GetFieldFont(gfx::Font::NORMAL); | 72 return OmniboxViewMac::GetNormalFieldFont(); |
73 } | 73 } |
74 | 74 |
75 NSPoint LocationBarDecoration::GetBubblePointInFrame(NSRect frame) { | 75 NSPoint LocationBarDecoration::GetBubblePointInFrame(NSRect frame) { |
76 // Clients that use a bubble should implement this. Can't be abstract | 76 // Clients that use a bubble should implement this. Can't be abstract |
77 // because too many LocationBarDecoration subclasses don't use a bubble. | 77 // because too many LocationBarDecoration subclasses don't use a bubble. |
78 // Can't live on subclasses only because it needs to be on a shared API. | 78 // Can't live on subclasses only because it needs to be on a shared API. |
79 NOTREACHED(); | 79 NOTREACHED(); |
80 return frame.origin; | 80 return frame.origin; |
81 } | 81 } |
82 | 82 |
(...skipping 13 matching lines...) Expand all Loading... |
96 text_rect.size.height = [str size].height; | 96 text_rect.size.height = [str size].height; |
97 text_rect.origin.y = roundf(NSMidY(frame) - NSHeight(text_rect) / 2.0) - 1; | 97 text_rect.origin.y = roundf(NSMidY(frame) - NSHeight(text_rect) / 2.0) - 1; |
98 [str drawInRect:text_rect]; | 98 [str drawInRect:text_rect]; |
99 } | 99 } |
100 | 100 |
101 // static | 101 // static |
102 NSSize LocationBarDecoration::GetLabelSize(NSString* label, | 102 NSSize LocationBarDecoration::GetLabelSize(NSString* label, |
103 NSDictionary* attributes) { | 103 NSDictionary* attributes) { |
104 return [label sizeWithAttributes:attributes]; | 104 return [label sizeWithAttributes:attributes]; |
105 } | 105 } |
OLD | NEW |