diff options
author | sky@google.com <sky@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-11-03 23:14:01 +0000 |
---|---|---|
committer | sky@google.com <sky@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-11-03 23:14:01 +0000 |
commit | 3ec1a3af311b95b325a3302679be1eb68e89e58e (patch) | |
tree | 61049c73993b824ce537cf62cea8acfb74cbf14a /chrome/browser/views/bookmark_editor_view.h | |
parent | 32f720c5a051885d45b79533522c06870e7037ff (diff) | |
download | chromium_src-3ec1a3af311b95b325a3302679be1eb68e89e58e.zip chromium_src-3ec1a3af311b95b325a3302679be1eb68e89e58e.tar.gz chromium_src-3ec1a3af311b95b325a3302679be1eb68e89e58e.tar.bz2 |
Miscellaneous bookmark manager polish:
. Adds a menu button on the bookmark manager. If I finish up import
I'll add a second one for importing.
. Creating new page/folder from menu items selects new item in table.
. I changed around the FolderBookmarkTableModel to copy the contents
into a vector (now extends VectorBackedTabledModel). This is
necessitated by TableView not providing a moved notification. The
problem with previous approach is that I sent out ModelChanged on
any change, which loses selection and causes things to snap around.
I considered adding a moved method to TableView, but it's too much
work at this time.
. Added persisting of divider location in bookmark manager.
. When focus is on table pressing enter on a folder descends into the
folder, and pressing backspace goes back up a folder.
BUG=674
TEST=none
Review URL: http://codereview.chromium.org/8967
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@4512 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/views/bookmark_editor_view.h')
-rw-r--r-- | chrome/browser/views/bookmark_editor_view.h | 32 |
1 files changed, 23 insertions, 9 deletions
diff --git a/chrome/browser/views/bookmark_editor_view.h b/chrome/browser/views/bookmark_editor_view.h index 4e6e317..2cd4b01 100644 --- a/chrome/browser/views/bookmark_editor_view.h +++ b/chrome/browser/views/bookmark_editor_view.h @@ -50,27 +50,39 @@ class BookmarkEditorView : public views::View, FRIEND_TEST(BookmarkEditorViewTest, ChangeURLNoTree); FRIEND_TEST(BookmarkEditorViewTest, ChangeTitleNoTree); public: + // Handler is notified when the BookmarkEditorView creates a new bookmark. + // Handler is owned by the BookmarkEditorView and deleted when it is deleted. + class Handler { + public: + virtual ~Handler() {} + virtual void NodeCreated(BookmarkNode* new_node) = 0; + }; + // An enumeration of the possible configurations offered. enum Configuration { SHOW_TREE, NO_TREE }; + BookmarkEditorView(Profile* profile, + BookmarkNode* parent, + BookmarkNode* node, + Configuration configuration, + Handler* handler); + + virtual ~BookmarkEditorView(); + // Shows the BookmarkEditorView editing |node|. If |node| is NULL a new entry // is created initially parented to |parent|. If |show_tree| is false the - // tree is not shown. + // tree is not shown. BookmarkEditorView takes ownership of |handler| and + // deletes it when done. |handler| may be null. See description of Handler + // for details. static void Show(HWND parent_window, Profile* profile, BookmarkNode* parent, BookmarkNode* node, - Configuration configuration); - - BookmarkEditorView(Profile* profile, - BookmarkNode* parent, - BookmarkNode* node, - Configuration configuration); - - virtual ~BookmarkEditorView(); + Configuration configuration, + Handler* handler); // DialogDelegate methods: virtual bool IsDialogButtonEnabled(DialogButton button) const; @@ -264,6 +276,8 @@ class BookmarkEditorView : public views::View, // Is the tree shown? bool show_tree_; + scoped_ptr<Handler> handler_; + DISALLOW_COPY_AND_ASSIGN(BookmarkEditorView); }; |