| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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_COCOA_BOOKMARK_EDITOR_CONTROLLER_H_ | 5 #ifndef CHROME_BROWSER_COCOA_BOOKMARK_EDITOR_CONTROLLER_H_ |
| 6 #define CHROME_BROWSER_COCOA_BOOKMARK_EDITOR_CONTROLLER_H_ | 6 #define CHROME_BROWSER_COCOA_BOOKMARK_EDITOR_CONTROLLER_H_ |
| 7 | 7 |
| 8 #import <Cocoa/Cocoa.h> | 8 #import <Cocoa/Cocoa.h> |
| 9 | 9 |
| 10 #include "base/scoped_ptr.h" | 10 #include "base/scoped_ptr.h" |
| 11 #include "base/scoped_nsobject.h" | 11 #include "base/scoped_nsobject.h" |
| 12 #include "chrome/browser/bookmarks/bookmark_editor.h" | 12 #include "chrome/browser/bookmarks/bookmark_editor.h" |
| 13 | 13 |
| 14 // A controller for the bookmark editor, opened with Edit... from the | 14 // A controller for the bookmark editor, opened with Edit... from the |
| 15 // context menu of a bookmark button. | 15 // context menu of a bookmark button. |
| 16 @interface BookmarkEditorController : NSWindowController { | 16 @interface BookmarkEditorController : NSWindowController { |
| 17 @private | 17 @private |
| 18 IBOutlet NSTextField* nameField_; | 18 IBOutlet NSTextField* nameField_; |
| 19 IBOutlet NSTextField* urlField_; | 19 IBOutlet NSTextField* urlField_; |
| 20 IBOutlet NSBrowser* browser_; | 20 IBOutlet NSBrowser* browser_; |
| 21 IBOutlet NSButton* okButton_; |
| 21 IBOutlet NSButton* newFolderButton_; | 22 IBOutlet NSButton* newFolderButton_; |
| 22 | 23 |
| 23 NSWindow* parentWindow_; | 24 NSWindow* parentWindow_; |
| 24 Profile* profile_; // weak | 25 Profile* profile_; // weak |
| 25 const BookmarkNode* parentNode_; // weak; owned by the model | 26 const BookmarkNode* parentNode_; // weak; owned by the model |
| 26 const BookmarkNode* node_; // weak; owned by the model | 27 const BookmarkNode* node_; // weak; owned by the model |
| 27 BookmarkEditor::Configuration configuration_; | 28 BookmarkEditor::Configuration configuration_; |
| 28 scoped_ptr<BookmarkEditor::Handler> handler_; // we take ownership | 29 scoped_ptr<BookmarkEditor::Handler> handler_; // we take ownership |
| 29 | 30 |
| 30 scoped_nsobject<NSString> initialName_; | 31 scoped_nsobject<NSString> initialName_; |
| 31 scoped_nsobject<NSString> initialUrl_; | 32 scoped_nsobject<NSString> initialUrl_; |
| 32 } | 33 } |
| 33 | 34 |
| 34 - (id)initWithParentWindow:(NSWindow*)parentWindow | 35 - (id)initWithParentWindow:(NSWindow*)parentWindow |
| 35 profile:(Profile*)profile | 36 profile:(Profile*)profile |
| 36 parent:(const BookmarkNode*)parent | 37 parent:(const BookmarkNode*)parent |
| 37 node:(const BookmarkNode*)node | 38 node:(const BookmarkNode*)node |
| 38 configuration:(BookmarkEditor::Configuration)configuration | 39 configuration:(BookmarkEditor::Configuration)configuration |
| 39 handler:(BookmarkEditor::Handler*)handler; | 40 handler:(BookmarkEditor::Handler*)handler; |
| 40 | 41 |
| 41 // Actions for the buttons at the bottom of the window. | 42 // Actions for the buttons at the bottom of the window. |
| 42 - (IBAction)newFolder:(id)sender; | 43 - (IBAction)newFolder:(id)sender; |
| 43 - (IBAction)cancel:(id)sender; | 44 - (IBAction)cancel:(id)sender; |
| 44 - (IBAction)ok:(id)sender; | 45 - (IBAction)ok:(id)sender; |
| 45 @end | 46 @end |
| 46 | 47 |
| 47 @interface BookmarkEditorController(TestingAPI) | 48 @interface BookmarkEditorController(TestingAPI) |
| 48 @property (assign) NSString* displayName; | 49 @property (assign) NSString* displayName; |
| 49 @property (assign) NSString* displayURL; | 50 @property (assign) NSString* displayURL; |
| 51 @property (readonly) BOOL okButtonEnabled; |
| 50 @end | 52 @end |
| 51 | 53 |
| 52 | 54 |
| 53 #endif /* CHROME_BROWSER_COCOA_BOOKMARK_EDITOR_CONTROLLER_H_ */ | 55 #endif /* CHROME_BROWSER_COCOA_BOOKMARK_EDITOR_CONTROLLER_H_ */ |
| 54 | 56 |
| OLD | NEW |