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

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
« no previous file with comments | « no previous file | chrome/browser/ui/cocoa/confirm_bubble_controller.mm » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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"
Mark Mentovai 2012/02/21 20:00:48 You don’t #import this, you #include it. Use #imp
Hironori Bono 2012/02/22 07:22:50 Done. Thanks for pointing it out. I copied the pre
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. When we successfully create a
Mark Mentovai 2012/02/21 20:00:48 Avoid use of “we” in comments. It’s meaningless an
Hironori Bono 2012/02/22 07:22:50 Done. Thanks for correcting my English.
29 // controller, it takes the ownership of the given 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_
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/ui/cocoa/confirm_bubble_controller.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698