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

Side by Side Diff: chrome/browser/ui/cocoa/confirm_bubble_controller.h

Issue 9414039: Use scoped_ptr<> to store ConfirmBubbleModel. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 8 years, 10 months 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 (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 #import "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.
Robert Sesek 2012/02/17 15:24:25 Adjust comment to say that it takes ownership of |
Hironori Bono 2012/02/22 07:22:50 Done.
28 - (id)initWithParent:(NSView*)parent 29 - (id)initWithParent:(NSView*)parent
29 origin:(CGPoint)origin 30 origin:(CGPoint)origin
30 model:(ConfirmBubbleModel*)model; 31 model:(ConfirmBubbleModel*)model;
31 32
32 // Access to the properties of the ConfirmBubbleModel object. These functions 33 // Access to the properties of the ConfirmBubbleModel object. These functions
33 // also converts C++ types returned by the ConfirmBubbleModel object to 34 // also converts C++ types returned by the ConfirmBubbleModel object to
34 // Objective-C types. 35 // Objective-C types.
35 - (NSPoint)origin; 36 - (NSPoint)origin;
36 - (NSString*)title; 37 - (NSString*)title;
37 - (NSString*)messageText; 38 - (NSString*)messageText;
38 - (NSString*)linkText; 39 - (NSString*)linkText;
39 - (NSString*)okButtonText; 40 - (NSString*)okButtonText;
40 - (NSString*)cancelButtonText; 41 - (NSString*)cancelButtonText;
41 - (BOOL)hasOkButton; 42 - (BOOL)hasOkButton;
42 - (BOOL)hasCancelButton; 43 - (BOOL)hasCancelButton;
43 - (NSImage*)icon; 44 - (NSImage*)icon;
44 45
45 // Handle actions from from the ConfirmBubbleView objet. 46 // Handle actions from from the ConfirmBubbleView objet.
46 - (void)accept; 47 - (void)accept;
47 - (void)cancel; 48 - (void)cancel;
48 - (void)linkClicked; 49 - (void)linkClicked;
49 50
50 @end 51 @end
51 52
52 #endif // CHROME_BROWSER_UI_COCOA_CONFIRM_BUBBLE_CONTROLLER_H_ 53 #endif // CHROME_BROWSER_UI_COCOA_CONFIRM_BUBBLE_CONTROLLER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698