| 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_VIEWS_BOOKMARK_EDITOR_VIEW_H_ | 5 #ifndef CHROME_BROWSER_VIEWS_BOOKMARK_EDITOR_VIEW_H_ |
| 6 #define CHROME_BROWSER_VIEWS_BOOKMARK_EDITOR_VIEW_H_ | 6 #define CHROME_BROWSER_VIEWS_BOOKMARK_EDITOR_VIEW_H_ |
| 7 | 7 |
| 8 #include <set> | 8 #include <set> |
| 9 | 9 |
| 10 #include "app/tree_node_model.h" | 10 #include "app/tree_node_model.h" |
| (...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 106 void Close(); | 106 void Close(); |
| 107 | 107 |
| 108 // Shows the context menu. | 108 // Shows the context menu. |
| 109 virtual void ShowContextMenu(View* source, | 109 virtual void ShowContextMenu(View* source, |
| 110 int x, | 110 int x, |
| 111 int y, | 111 int y, |
| 112 bool is_mouse_gesture); | 112 bool is_mouse_gesture); |
| 113 | 113 |
| 114 private: | 114 private: |
| 115 // Type of node in the tree. | 115 // Type of node in the tree. |
| 116 typedef TreeNodeWithValue<int> EditorNode; | 116 typedef TreeNodeWithValue<int64> EditorNode; |
| 117 | 117 |
| 118 // Model for the TreeView. Trivial subclass that doesn't allow titles with | 118 // Model for the TreeView. Trivial subclass that doesn't allow titles with |
| 119 // empty strings. | 119 // empty strings. |
| 120 class EditorTreeModel : public TreeNodeModel<EditorNode> { | 120 class EditorTreeModel : public TreeNodeModel<EditorNode> { |
| 121 public: | 121 public: |
| 122 explicit EditorTreeModel(EditorNode* root) | 122 explicit EditorTreeModel(EditorNode* root) |
| 123 : TreeNodeModel<EditorNode>(root) {} | 123 : TreeNodeModel<EditorNode>(root) {} |
| 124 | 124 |
| 125 virtual void SetTitle(TreeModelNode* node, | 125 virtual void SetTitle(TreeModelNode* node, |
| 126 const std::wstring& title) { | 126 const std::wstring& title) { |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 168 | 168 |
| 169 // Creates a returns the new root node. This invokes CreateNodes to do | 169 // Creates a returns the new root node. This invokes CreateNodes to do |
| 170 // the real work. | 170 // the real work. |
| 171 EditorNode* CreateRootNode(); | 171 EditorNode* CreateRootNode(); |
| 172 | 172 |
| 173 // Adds and creates a child node in b_node for all children of bb_node that | 173 // Adds and creates a child node in b_node for all children of bb_node that |
| 174 // are groups. | 174 // are groups. |
| 175 void CreateNodes(const BookmarkNode* bb_node, EditorNode* b_node); | 175 void CreateNodes(const BookmarkNode* bb_node, EditorNode* b_node); |
| 176 | 176 |
| 177 // Returns the node with the specified id, or NULL if one can't be found. | 177 // Returns the node with the specified id, or NULL if one can't be found. |
| 178 EditorNode* FindNodeWithID(BookmarkEditorView::EditorNode* node, int id); | 178 EditorNode* FindNodeWithID(BookmarkEditorView::EditorNode* node, int64 id); |
| 179 | 179 |
| 180 // Invokes ApplyEdits with the selected node. | 180 // Invokes ApplyEdits with the selected node. |
| 181 void ApplyEdits(); | 181 void ApplyEdits(); |
| 182 | 182 |
| 183 // Applies the edits done by the user. |parent| gives the parent of the URL | 183 // Applies the edits done by the user. |parent| gives the parent of the URL |
| 184 // being edited. | 184 // being edited. |
| 185 void ApplyEdits(EditorNode* parent); | 185 void ApplyEdits(EditorNode* parent); |
| 186 | 186 |
| 187 // Recursively adds newly created groups and sets the title of nodes to | 187 // Recursively adds newly created groups and sets the title of nodes to |
| 188 // match the user edited title. | 188 // match the user edited title. |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 256 | 256 |
| 257 // Is the tree shown? | 257 // Is the tree shown? |
| 258 bool show_tree_; | 258 bool show_tree_; |
| 259 | 259 |
| 260 scoped_ptr<BookmarkEditor::Handler> handler_; | 260 scoped_ptr<BookmarkEditor::Handler> handler_; |
| 261 | 261 |
| 262 DISALLOW_COPY_AND_ASSIGN(BookmarkEditorView); | 262 DISALLOW_COPY_AND_ASSIGN(BookmarkEditorView); |
| 263 }; | 263 }; |
| 264 | 264 |
| 265 #endif // CHROME_BROWSER_VIEWS_BOOKMARK_EDITOR_VIEW_H_ | 265 #endif // CHROME_BROWSER_VIEWS_BOOKMARK_EDITOR_VIEW_H_ |
| OLD | NEW |