| 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 <Cocoa/Cocoa.h> | 5 #import <Cocoa/Cocoa.h> |
| 6 | 6 |
| 7 #import "base/mac/cocoa_protocols.h" | 7 #import "base/mac/cocoa_protocols.h" |
| 8 #include "base/scoped_ptr.h" | 8 #include "base/scoped_ptr.h" |
| 9 | 9 |
| 10 namespace BaseBubbleControllerInternal { | 10 namespace BaseBubbleControllerInternal { |
| (...skipping 15 matching lines...) Expand all Loading... |
| 26 // 4. Hook up the File Owner's |bubble_| to the InfoBubbleView in the xib. | 26 // 4. Hook up the File Owner's |bubble_| to the InfoBubbleView in the xib. |
| 27 @interface BaseBubbleController : NSWindowController<NSWindowDelegate> { | 27 @interface BaseBubbleController : NSWindowController<NSWindowDelegate> { |
| 28 @private | 28 @private |
| 29 NSWindow* parentWindow_; // weak | 29 NSWindow* parentWindow_; // weak |
| 30 NSPoint anchor_; | 30 NSPoint anchor_; |
| 31 IBOutlet InfoBubbleView* bubble_; // to set arrow position | 31 IBOutlet InfoBubbleView* bubble_; // to set arrow position |
| 32 // Bridge that listens for notifications. | 32 // Bridge that listens for notifications. |
| 33 scoped_ptr<BaseBubbleControllerInternal::Bridge> base_bridge_; | 33 scoped_ptr<BaseBubbleControllerInternal::Bridge> base_bridge_; |
| 34 } | 34 } |
| 35 | 35 |
| 36 @property (nonatomic, readonly) NSWindow* parentWindow; | 36 @property(nonatomic, readonly) NSWindow* parentWindow; |
| 37 @property (nonatomic, assign) NSPoint anchorPoint; | 37 @property(nonatomic, assign) NSPoint anchorPoint; |
| 38 @property (nonatomic, readonly) InfoBubbleView* bubble; | 38 @property(nonatomic, readonly) InfoBubbleView* bubble; |
| 39 | 39 |
| 40 // Creates a bubble. |nibPath| is just the basename, e.g. @"FirstRunBubble". | 40 // Creates a bubble. |nibPath| is just the basename, e.g. @"FirstRunBubble". |
| 41 // |anchoredAt| is in screen space. You need to call -showWindow: to make the | 41 // |anchoredAt| is in screen space. You need to call -showWindow: to make the |
| 42 // bubble visible. It will autorelease itself when the user dismisses the | 42 // bubble visible. It will autorelease itself when the user dismisses the |
| 43 // bubble. | 43 // bubble. |
| 44 // This is the designated initializer. | 44 // This is the designated initializer. |
| 45 - (id)initWithWindowNibPath:(NSString*)nibPath | 45 - (id)initWithWindowNibPath:(NSString*)nibPath |
| 46 parentWindow:(NSWindow*)parentWindow | 46 parentWindow:(NSWindow*)parentWindow |
| 47 anchoredAt:(NSPoint)anchoredAt; | 47 anchoredAt:(NSPoint)anchoredAt; |
| 48 | 48 |
| 49 | 49 |
| 50 // Creates a bubble. |nibPath| is just the basename, e.g. @"FirstRunBubble". | 50 // Creates a bubble. |nibPath| is just the basename, e.g. @"FirstRunBubble". |
| 51 // |view| must be in a window. The bubble will point at |offset| relative to | 51 // |view| must be in a window. The bubble will point at |offset| relative to |
| 52 // |view|'s lower left corner. You need to call -showWindow: to make the | 52 // |view|'s lower left corner. You need to call -showWindow: to make the |
| 53 // bubble visible. It will autorelease itself when the user dismisses the | 53 // bubble visible. It will autorelease itself when the user dismisses the |
| 54 // bubble. | 54 // bubble. |
| 55 - (id)initWithWindowNibPath:(NSString*)nibPath | 55 - (id)initWithWindowNibPath:(NSString*)nibPath |
| 56 relativeToView:(NSView*)view | 56 relativeToView:(NSView*)view |
| 57 offset:(NSPoint)offset; | 57 offset:(NSPoint)offset; |
| 58 | 58 |
| 59 | 59 |
| 60 // For subclasses that do not load from a XIB, this will simply set the instance | 60 // For subclasses that do not load from a XIB, this will simply set the instance |
| 61 // variables appropriately. This will also replace the |-[self window]|'s | 61 // variables appropriately. This will also replace the |-[self window]|'s |
| 62 // contentView with an instance of InfoBubbleView. | 62 // contentView with an instance of InfoBubbleView. |
| 63 - (id)initWithWindow:(NSWindow*)theWindow | 63 - (id)initWithWindow:(NSWindow*)theWindow |
| 64 parentWindow:(NSWindow*)parentWindow | 64 parentWindow:(NSWindow*)parentWindow |
| 65 anchoredAt:(NSPoint)anchoredAt; | 65 anchoredAt:(NSPoint)anchoredAt; |
| 66 | 66 |
| 67 @end | 67 @end |
| OLD | NEW |