| OLD | NEW |
| (Empty) |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #import "chrome/browser/ui/cocoa/fullscreen_exit_bubble_view.h" | |
| 6 | |
| 7 #import "chrome/browser/ui/cocoa/nsview_additions.h" | |
| 8 #import "chrome/browser/ui/cocoa/themed_window.h" | |
| 9 #import "chrome/browser/ui/cocoa/url_drop_target.h" | |
| 10 #import "chrome/browser/ui/cocoa/view_id_util.h" | |
| 11 #include "ui/gfx/scoped_ns_graphics_context_save_gstate_mac.h" | |
| 12 | |
| 13 CGFloat kCurveSize = 8; | |
| 14 | |
| 15 @implementation FullscreenExitBubbleView | |
| 16 | |
| 17 - (void)drawRect:(NSRect)rect { | |
| 18 const CGFloat lineWidth = [self cr_lineWidth]; | |
| 19 | |
| 20 rect = NSOffsetRect([self bounds], 0, lineWidth*2); | |
| 21 | |
| 22 NSPoint topLeft = NSMakePoint(NSMinX(rect), NSMaxY(rect)); | |
| 23 NSPoint topRight = NSMakePoint(NSMaxX(rect), NSMaxY(rect)); | |
| 24 NSPoint midLeft = | |
| 25 NSMakePoint(NSMinX(rect), NSMinY(rect) + kCurveSize); | |
| 26 NSPoint midRight = | |
| 27 NSMakePoint(NSMaxX(rect), NSMinY(rect) + kCurveSize); | |
| 28 NSPoint bottomLeft = | |
| 29 NSMakePoint(NSMinX(rect) + kCurveSize, NSMinY(rect)); | |
| 30 NSPoint bottomRight = | |
| 31 NSMakePoint(NSMaxX(rect) - kCurveSize, NSMinY(rect)); | |
| 32 | |
| 33 NSBezierPath* path = [NSBezierPath bezierPath]; | |
| 34 [path moveToPoint:topLeft]; | |
| 35 [path appendBezierPathWithArcWithCenter:NSMakePoint(bottomLeft.x, midLeft.y) | |
| 36 radius:kCurveSize startAngle:180 endAngle:270]; | |
| 37 | |
| 38 [path lineToPoint:bottomRight]; | |
| 39 [path appendBezierPathWithArcWithCenter:NSMakePoint(bottomRight.x, midRight.y) | |
| 40 radius:kCurveSize startAngle:270 endAngle:360]; | |
| 41 [path lineToPoint:topRight]; | |
| 42 | |
| 43 { | |
| 44 gfx::ScopedNSGraphicsContextSaveGState scopedGState; | |
| 45 [path addClip]; | |
| 46 | |
| 47 const NSRect bounds = [self bounds]; | |
| 48 | |
| 49 [[NSColor colorWithDeviceWhite:0 alpha:0.7] set]; | |
| 50 NSRectFillUsingOperation(bounds, NSCompositeSourceOver); | |
| 51 } | |
| 52 | |
| 53 } | |
| 54 | |
| 55 // Eat all mouse events, to prevent clicks from falling through to views below. | |
| 56 - (void)mouseDown:(NSEvent *)theEvent { | |
| 57 } | |
| 58 | |
| 59 - (void)rightMouseDown:(NSEvent *)theEvent { | |
| 60 } | |
| 61 | |
| 62 - (void)otherMouseDown:(NSEvent *)theEvent { | |
| 63 } | |
| 64 | |
| 65 - (void)mouseUp:(NSEvent *)theEvent { | |
| 66 } | |
| 67 | |
| 68 - (void)rightMouseUp:(NSEvent *)theEvent { | |
| 69 } | |
| 70 | |
| 71 - (void)otherMouseUp:(NSEvent *)theEvent { | |
| 72 } | |
| 73 | |
| 74 - (void)mouseMoved:(NSEvent *)theEvent { | |
| 75 } | |
| 76 | |
| 77 - (void)mouseDragged:(NSEvent *)theEvent { | |
| 78 } | |
| 79 | |
| 80 - (void)rightMouseDragged:(NSEvent *)theEvent { | |
| 81 } | |
| 82 | |
| 83 - (void)otherMouseDragged:(NSEvent *)theEvent { | |
| 84 } | |
| 85 | |
| 86 // Specifies that mouse events over this view should be ignored by the | |
| 87 // render host. | |
| 88 - (BOOL)nonWebContentView { | |
| 89 return YES; | |
| 90 } | |
| 91 | |
| 92 @end | |
| OLD | NEW |