| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_CONFIRM_BUBBLE_CONTROLLER_H_ | 5 #ifndef CHROME_BROWSER_UI_COCOA_CONFIRM_BUBBLE_CONTROLLER_H_ |
| 6 #define CHROME_BROWSER_UI_COCOA_CONFIRM_BUBBLE_CONTROLLER_H_ | 6 #define CHROME_BROWSER_UI_COCOA_CONFIRM_BUBBLE_CONTROLLER_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #import <Cocoa/Cocoa.h> | 9 #import <Cocoa/Cocoa.h> |
| 10 | 10 |
| 11 #import "base/mac/cocoa_protocols.h" | 11 #import "base/mac/cocoa_protocols.h" |
| 12 #include "base/memory/scoped_ptr.h" |
| 12 | 13 |
| 13 class ConfirmBubbleModel; | 14 class ConfirmBubbleModel; |
| 14 | 15 |
| 15 // A view controller that manages a bubble view and becomes a proxy between | 16 // A view controller that manages a bubble view and becomes a proxy between |
| 16 // the view and the ConfirmBubbleModel object. This class is internally used | 17 // the view and the ConfirmBubbleModel object. This class is internally used |
| 17 // in ConfirmBubbleView::Show() and users do not have to change this class | 18 // in ConfirmBubbleView::Show() and users do not have to change this class |
| 18 // directly. | 19 // directly. |
| 19 @interface ConfirmBubbleController : | 20 @interface ConfirmBubbleController : |
| 20 NSViewController<NSTextViewDelegate> { | 21 NSViewController<NSTextViewDelegate> { |
| 21 @private | 22 @private |
| 22 NSView* parent_; // weak | 23 NSView* parent_; // weak |
| 23 CGPoint origin_; | 24 CGPoint origin_; |
| 24 ConfirmBubbleModel* model_; // weak | 25 scoped_ptr<ConfirmBubbleModel> model_; |
| 25 } | 26 } |
| 26 | 27 |
| 27 // Creates a ConfirmBubbleController object. | 28 // Creates a ConfirmBubbleController object. The ConfirmBubbleController |
| 29 // controller takes the ownership of the passed-in ConfirmBubbleModel. |
| 28 - (id)initWithParent:(NSView*)parent | 30 - (id)initWithParent:(NSView*)parent |
| 29 origin:(CGPoint)origin | 31 origin:(CGPoint)origin |
| 30 model:(ConfirmBubbleModel*)model; | 32 model:(ConfirmBubbleModel*)model; |
| 31 | 33 |
| 32 // Access to the properties of the ConfirmBubbleModel object. These functions | 34 // Access to the properties of the ConfirmBubbleModel object. These functions |
| 33 // also converts C++ types returned by the ConfirmBubbleModel object to | 35 // also converts C++ types returned by the ConfirmBubbleModel object to |
| 34 // Objective-C types. | 36 // Objective-C types. |
| 35 - (NSPoint)origin; | 37 - (NSPoint)origin; |
| 36 - (NSString*)title; | 38 - (NSString*)title; |
| 37 - (NSString*)messageText; | 39 - (NSString*)messageText; |
| 38 - (NSString*)linkText; | 40 - (NSString*)linkText; |
| 39 - (NSString*)okButtonText; | 41 - (NSString*)okButtonText; |
| 40 - (NSString*)cancelButtonText; | 42 - (NSString*)cancelButtonText; |
| 41 - (BOOL)hasOkButton; | 43 - (BOOL)hasOkButton; |
| 42 - (BOOL)hasCancelButton; | 44 - (BOOL)hasCancelButton; |
| 43 - (NSImage*)icon; | 45 - (NSImage*)icon; |
| 44 | 46 |
| 45 // Handle actions from from the ConfirmBubbleView objet. | 47 // Handle actions from from the ConfirmBubbleView objet. |
| 46 - (void)accept; | 48 - (void)accept; |
| 47 - (void)cancel; | 49 - (void)cancel; |
| 48 - (void)linkClicked; | 50 - (void)linkClicked; |
| 49 | 51 |
| 50 @end | 52 @end |
| 51 | 53 |
| 52 #endif // CHROME_BROWSER_UI_COCOA_CONFIRM_BUBBLE_CONTROLLER_H_ | 54 #endif // CHROME_BROWSER_UI_COCOA_CONFIRM_BUBBLE_CONTROLLER_H_ |
| OLD | NEW |