summaryrefslogtreecommitdiffstats
path: root/chrome/browser/cocoa/bookmark_editor_controller.h
diff options
context:
space:
mode:
authorjrg@chromium.org <jrg@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-07-21 23:57:19 +0000
committerjrg@chromium.org <jrg@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-07-21 23:57:19 +0000
commitee01535e43949832b8fb57a74d892390e01d36dd (patch)
tree630574b28df21ef914369b9a16c0bfdca1b74527 /chrome/browser/cocoa/bookmark_editor_controller.h
parentd7aef10706a8e8b5da86d48113136887b3ca97a1 (diff)
downloadchromium_src-ee01535e43949832b8fb57a74d892390e01d36dd.zip
chromium_src-ee01535e43949832b8fb57a74d892390e01d36dd.tar.gz
chromium_src-ee01535e43949832b8fb57a74d892390e01d36dd.tar.bz2
Implement bookmark editor. No tree display or hierarchy movement, but
name/url editing works. Get to the edotir from a context menu (Edit, Add Page). Also Implement Open All Bookmarks menu item. BUG=http://crbug.com/8381, http://crbug.com/17006 TEST=Add some bookmarks. Right-click on a bookmark and pick Edit. Test editing the name and URL. Make sure you can't add a bogus URL. Right-click on a bookmark or the bar and Add Page. Fill in name and URL fields to add a new bookmark. Right-click Open All Bookmarks and make sure it hoses your machine. Review URL: http://codereview.chromium.org/155874 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@21241 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/cocoa/bookmark_editor_controller.h')
-rw-r--r--chrome/browser/cocoa/bookmark_editor_controller.h54
1 files changed, 54 insertions, 0 deletions
diff --git a/chrome/browser/cocoa/bookmark_editor_controller.h b/chrome/browser/cocoa/bookmark_editor_controller.h
new file mode 100644
index 0000000..e297ea3
--- /dev/null
+++ b/chrome/browser/cocoa/bookmark_editor_controller.h
@@ -0,0 +1,54 @@
+// Copyright (c) 2009 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROME_BROWSER_COCOA_BOOKMARK_EDITOR_CONTROLLER_H_
+#define CHROME_BROWSER_COCOA_BOOKMARK_EDITOR_CONTROLLER_H_
+
+#import <Cocoa/Cocoa.h>
+
+#include "base/scoped_ptr.h"
+#include "base/scoped_nsobject.h"
+#include "chrome/browser/bookmarks/bookmark_editor.h"
+
+// A controller for the bookmark editor, opened with Edit... from the
+// context menu of a bookmark button.
+@interface BookmarkEditorController : NSWindowController {
+ @private
+ IBOutlet NSTextField* nameField_;
+ IBOutlet NSTextField* urlField_;
+ IBOutlet NSBrowser* browser_;
+ IBOutlet NSButton* newFolderButton_;
+
+ NSWindow* parentWindow_;
+ Profile* profile_; // weak
+ const BookmarkNode* parentNode_; // weak; owned by the model
+ const BookmarkNode* node_; // weak; owned by the model
+ BookmarkEditor::Configuration configuration_;
+ scoped_ptr<BookmarkEditor::Handler> handler_; // we take ownership
+
+ scoped_nsobject<NSString> initialName_;
+ scoped_nsobject<NSString> initialUrl_;
+}
+
+- (id)initWithParentWindow:(NSWindow*)parentWindow
+ profile:(Profile*)profile
+ parent:(const BookmarkNode*)parent
+ node:(const BookmarkNode*)node
+ configuration:(BookmarkEditor::Configuration)configuration
+ handler:(BookmarkEditor::Handler*)handler;
+
+// Actions for the buttons at the bottom of the window.
+- (IBAction)newFolder:(id)sender;
+- (IBAction)cancel:(id)sender;
+- (IBAction)ok:(id)sender;
+@end
+
+@interface BookmarkEditorController(TestingAPI)
+@property (assign) NSString* displayName;
+@property (assign) NSString* displayURL;
+@end
+
+
+#endif /* CHROME_BROWSER_COCOA_BOOKMARK_EDITOR_CONTROLLER_H_ */
+