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

Unified Diff: chrome/browser/ui/cocoa/info_bubble_view.mm

Issue 1162393003: Replace info_bubble::BubbleArrowLocation with views::BubbleBorder::Arrow (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix compile in test Created 5 years, 7 months 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/cocoa/info_bubble_view.mm
diff --git a/chrome/browser/ui/cocoa/info_bubble_view.mm b/chrome/browser/ui/cocoa/info_bubble_view.mm
index 90f89e971ac5ea75588909aed0593de66075bba1..6f2663d2ea7cb34399f77ccb3e07ca650da01108 100644
--- a/chrome/browser/ui/cocoa/info_bubble_view.mm
+++ b/chrome/browser/ui/cocoa/info_bubble_view.mm
@@ -15,7 +15,7 @@
- (id)initWithFrame:(NSRect)frameRect {
if ((self = [super initWithFrame:frameRect])) {
- arrowLocation_ = info_bubble::kTopLeft;
+ arrowLocation_ = views::BubbleBorder::TOP_LEFT;
alignment_ = info_bubble::kAlignArrowToAnchor;
cornerFlags_ = info_bubble::kRoundedAllCorners;
backgroundColor_.reset([[NSColor whiteColor] retain]);
@@ -26,7 +26,7 @@
- (void)drawRect:(NSRect)rect {
// Make room for the border to be seen.
NSRect bounds = [self bounds];
- if (arrowLocation_ != info_bubble::kNoArrow) {
+ if (arrowLocation_ != views::BubbleBorder::NONE) {
bounds.size.height -= info_bubble::kBubbleArrowHeight;
}
rect.size.height -= info_bubble::kBubbleArrowHeight;
@@ -46,17 +46,17 @@
// Add the bubble arrow.
CGFloat dX = 0;
switch (arrowLocation_) {
- case info_bubble::kTopLeft:
+ case views::BubbleBorder::TOP_LEFT:
dX = info_bubble::kBubbleArrowXOffset;
break;
- case info_bubble::kTopRight:
+ case views::BubbleBorder::TOP_RIGHT:
dX = NSWidth(bounds) - info_bubble::kBubbleArrowXOffset -
info_bubble::kBubbleArrowWidth;
break;
- case info_bubble::kTopCenter:
+ case views::BubbleBorder::TOP_CENTER:
dX = NSMidX(bounds) - info_bubble::kBubbleArrowWidth / 2.0;
break;
- case info_bubble::kNoArrow:
+ case views::BubbleBorder::NONE:
break;
default:
NOTREACHED();
@@ -65,7 +65,7 @@
NSPoint arrowStart = NSMakePoint(NSMinX(bounds), NSMaxY(bounds));
arrowStart.x += dX;
[bezier moveToPoint:NSMakePoint(arrowStart.x, arrowStart.y)];
- if (arrowLocation_ != info_bubble::kNoArrow) {
+ if (arrowLocation_ != views::BubbleBorder::NONE) {
[bezier lineToPoint:NSMakePoint(arrowStart.x +
info_bubble::kBubbleArrowWidth / 2.0,
arrowStart.y +
@@ -84,13 +84,13 @@
info_bubble::kBubbleArrowXOffset + info_bubble::kBubbleArrowWidth / 2.0;
CGFloat xOffset = 0.0;
switch(arrowLocation_) {
- case info_bubble::kTopRight:
+ case views::BubbleBorder::TOP_RIGHT:
xOffset = NSMaxX(bounds) - tipXOffset;
break;
- case info_bubble::kTopLeft:
+ case views::BubbleBorder::TOP_LEFT:
xOffset = NSMinX(bounds) + tipXOffset;
break;
- case info_bubble::kTopCenter:
+ case views::BubbleBorder::TOP_CENTER:
xOffset = NSMidX(bounds);
break;
default:
« no previous file with comments | « chrome/browser/ui/cocoa/info_bubble_view.h ('k') | chrome/browser/ui/cocoa/profiles/avatar_menu_bubble_controller.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698