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

Side by Side Diff: chrome/browser/ui/cocoa/autofill/autofill_notification_controller.h

Issue 54303007: [rAc OSX] Add support for tooltips in notifications. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 7 years, 1 month 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 #ifndef CHROME_BROWSER_UI_COCOA_AUTOFILL_AUTOFILL_NOTIFICATION_CONTROLLER_H_ 5 #ifndef CHROME_BROWSER_UI_COCOA_AUTOFILL_AUTOFILL_NOTIFICATION_CONTROLLER_H_
6 #define CHROME_BROWSER_UI_COCOA_AUTOFILL_AUTOFILL_NOTIFICATION_CONTROLLER_H_ 6 #define CHROME_BROWSER_UI_COCOA_AUTOFILL_AUTOFILL_NOTIFICATION_CONTROLLER_H_
7 7
8 #import <Cocoa/Cocoa.h> 8 #import <Cocoa/Cocoa.h>
9 9
10 #include "base/mac/scoped_nsobject.h" 10 #include "base/mac/scoped_nsobject.h"
11 #import "chrome/browser/ui/cocoa/autofill/autofill_layout.h" 11 #import "chrome/browser/ui/cocoa/autofill/autofill_layout.h"
12 12
13 namespace autofill {
14 class DialogNotification;
15 }
16
13 // Contains a single notification for requestAutocomplete dialog. 17 // Contains a single notification for requestAutocomplete dialog.
14 @interface AutofillNotificationController : NSViewController<AutofillLayout> { 18 @interface AutofillNotificationController : NSViewController<AutofillLayout> {
15 @private 19 @private
16 // NSTextField for label. 20 // NSTextField for label.
17 base::scoped_nsobject<NSTextField> textfield_; 21 base::scoped_nsobject<NSTextField> textfield_;
18 22
19 // Optional checkbox. 23 // Optional checkbox.
20 base::scoped_nsobject<NSButton> checkbox_; 24 base::scoped_nsobject<NSButton> checkbox_;
25
26 // Optional tooltip icon.
27 base::scoped_nsobject<NSImageView> tooltipIcon_;
21 } 28 }
22 29
23 @property(nonatomic, readonly) NSTextField* textfield; 30 @property(nonatomic, readonly) NSTextField* textfield;
24 @property(nonatomic, readonly) NSButton* checkbox; 31 @property(nonatomic, readonly) NSButton* checkbox;
25 @property(nonatomic, retain) NSColor* backgroundColor; 32 @property(nonatomic, readonly) NSImageView* tooltipIcon;
26 @property(nonatomic, retain) NSColor* textColor;
27 @property(nonatomic, copy) NSString* text; // Label text.
28 33
29 // Designated initializer. 34 // Designated initializer. Initializes the controller as specified by
30 - (id)init; 35 // |notification|.
36 - (id)initWithNotification:(const autofill::DialogNotification*)notification;
31 37
32 // Displays arrow on top of notification if set to YES. |anchorView| determines 38 // Displays arrow on top of notification if set to YES. |anchorView| determines
33 // the arrow position - the tip of the arrow is centered on the horizontal 39 // the arrow position - the tip of the arrow is centered on the horizontal
34 // midpoint of the anchorView. 40 // midpoint of the anchorView.
35 - (void)setHasArrow:(BOOL)hasArrow withAnchorView:(NSView*)anchorView; 41 - (void)setHasArrow:(BOOL)hasArrow withAnchorView:(NSView*)anchorView;
36 42
37 // Indicates if the controller draws an arrow. 43 // Indicates if the controller draws an arrow.
38 - (BOOL)hasArrow; 44 - (BOOL)hasArrow;
39 45
40 // Enables the optional checkbox.
41 - (void)setHasCheckbox:(BOOL)hasCheckbox;
42
43 // Compute preferred size for given width. 46 // Compute preferred size for given width.
44 - (NSSize)preferredSizeForWidth:(CGFloat)width; 47 - (NSSize)preferredSizeForWidth:(CGFloat)width;
45 48
46 @end 49 @end
47 50
48 #endif // CHROME_BROWSER_UI_COCOA_AUTOFILL_AUTOFILL_NOTIFICATION_CONTROLLER_H_ 51 #endif // CHROME_BROWSER_UI_COCOA_AUTOFILL_AUTOFILL_NOTIFICATION_CONTROLLER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698