Chromium Code Reviews| Index: chrome/browser/ui/cocoa/fullscreen_exit_bubble_view.mm |
| diff --git a/chrome/browser/ui/cocoa/fullscreen_exit_bubble_view.mm b/chrome/browser/ui/cocoa/fullscreen_exit_bubble_view.mm |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..022b4c28d96ce3a91ae12eeb8a9eada08ab19114 |
| --- /dev/null |
| +++ b/chrome/browser/ui/cocoa/fullscreen_exit_bubble_view.mm |
| @@ -0,0 +1,98 @@ |
| +// Copyright (c) 2011 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#import "chrome/browser/ui/cocoa/fullscreen_exit_bubble_view.h" |
| + |
| +#import "chrome/browser/ui/cocoa/nsview_additions.h" |
| +#import "chrome/browser/ui/cocoa/themed_window.h" |
| +#import "chrome/browser/ui/cocoa/url_drop_target.h" |
| +#import "chrome/browser/ui/cocoa/view_id_util.h" |
| +#include "ui/gfx/scoped_ns_graphics_context_save_gstate_mac.h" |
| + |
| +namespace { |
|
Nico
2011/09/15 04:37:32
not needed
jeremya
2011/09/15 06:33:28
Done.
|
| +CGFloat kCurveSize = 8; |
| +} // end namespace |
| + |
| +@implementation FullscreenExitBubbleView |
| + |
| +- (void)drawRect:(NSRect)rect { |
| + const CGFloat lineWidth = [self cr_lineWidth]; |
| + |
| + rect = NSOffsetRect([self bounds], 0, lineWidth*2); |
| + |
| + NSPoint topLeft = NSMakePoint(NSMinX(rect), NSMaxY(rect)); |
| + NSPoint topRight = NSMakePoint(NSMaxX(rect), NSMaxY(rect)); |
| + NSPoint midLeft = |
| + NSMakePoint(NSMinX(rect), NSMinY(rect) + kCurveSize); |
| + NSPoint midRight = |
| + NSMakePoint(NSMaxX(rect), NSMinY(rect) + kCurveSize); |
| + NSPoint bottomLeft = |
| + NSMakePoint(NSMinX(rect) + kCurveSize, NSMinY(rect)); |
| + NSPoint bottomRight = |
| + NSMakePoint(NSMaxX(rect) - kCurveSize, NSMinY(rect)); |
| + |
| + NSBezierPath* path = [NSBezierPath bezierPath]; |
| + [path moveToPoint:topLeft]; |
| + [path appendBezierPathWithArcWithCenter:NSMakePoint(bottomLeft.x, midLeft.y) |
| + radius:kCurveSize startAngle:180 endAngle:270]; |
| + |
| + [path lineToPoint:bottomRight]; |
| + [path appendBezierPathWithArcWithCenter:NSMakePoint(bottomRight.x, midRight.y) |
| + radius:kCurveSize startAngle:270 endAngle:360]; |
| + [path lineToPoint:topRight]; |
| + |
| + { |
| + gfx::ScopedNSGraphicsContextSaveGState scopedGState; |
| + [path addClip]; |
| + |
| + const NSRect bounds = [self bounds]; |
| + |
| + [[NSColor colorWithDeviceWhite:0 alpha:0.7] set]; |
| + NSRectFillUsingOperation(bounds, NSCompositeSourceOver); |
| + } |
| + |
| +} |
| + |
| +// Eat all mouse events, to prevent clicks from falling through to views below. |
| +- (void)mouseDown:(NSEvent *)theEvent { |
| +} |
| + |
| +- (void)rightMouseDown:(NSEvent *)theEvent { |
| +} |
| + |
| +- (void)otherMouseDown:(NSEvent *)theEvent { |
| +} |
| + |
| +- (void)mouseUp:(NSEvent *)theEvent { |
| +} |
| + |
| +- (void)rightMouseUp:(NSEvent *)theEvent { |
| +} |
| + |
| +- (void)otherMouseUp:(NSEvent *)theEvent { |
| +} |
| + |
| +- (void)mouseMoved:(NSEvent *)theEvent { |
| +} |
| + |
| +- (void)mouseDragged:(NSEvent *)theEvent { |
| +} |
| + |
| +- (void)rightMouseDragged:(NSEvent *)theEvent { |
| +} |
| + |
| +- (void)otherMouseDragged:(NSEvent *)theEvent { |
| +} |
| + |
| +- (ViewID)viewID { |
| + return VIEW_ID_FIND_IN_PAGE; |
|
Nico
2011/09/15 04:37:32
!!
jeremya
2011/09/15 06:33:28
I can't tell what this was useful for in FindBar.
|
| +} |
| + |
| +// Specifies that mouse events over this view should be ignored by the |
| +// render host. |
| +- (BOOL)nonWebContentView { |
| + return YES; |
| +} |
| + |
| +@end |