OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 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 | 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/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
9 | 9 |
10 namespace BaseBubbleControllerInternal { | 10 namespace BaseBubbleControllerInternal { |
(...skipping 12 matching lines...) Expand all Loading... |
23 // delegate. | 23 // delegate. |
24 // 2. Create a subclass of BaseBubbleController. | 24 // 2. Create a subclass of BaseBubbleController. |
25 // 3. Change the xib's File Owner to your subclass. | 25 // 3. Change the xib's File Owner to your subclass. |
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> baseBridge_; |
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. |
(...skipping 18 matching lines...) Expand all Loading... |
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 // Creates an autoreleased separator view with a given frame. The height of the | 67 // Creates an autoreleased separator view with a given frame. The height of the |
68 // frame is ignored. | 68 // frame is ignored. |
69 - (NSBox*)separatorWithFrame:(NSRect)frame; | 69 - (NSBox*)separatorWithFrame:(NSRect)frame; |
70 | 70 |
71 @end | 71 @end |
OLD | NEW |