OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 #include "chrome/browser/ui/bookmarks/bookmark_editor.h" | 5 #include "chrome/browser/ui/bookmarks/bookmark_editor.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "chrome/grit/generated_resources.h" | 8 #include "chrome/grit/generated_resources.h" |
9 #include "components/bookmarks/browser/bookmark_model.h" | 9 #include "components/bookmarks/browser/bookmark_model.h" |
10 | 10 |
11 using bookmarks::BookmarkModel; | 11 using bookmarks::BookmarkModel; |
| 12 using bookmarks::BookmarkNode; |
12 | 13 |
13 namespace { | 14 namespace { |
14 | 15 |
15 const BookmarkNode* CreateNewNode(BookmarkModel* model, | 16 const BookmarkNode* CreateNewNode(BookmarkModel* model, |
16 const BookmarkNode* parent, | 17 const BookmarkNode* parent, |
17 const BookmarkEditor::EditDetails& details, | 18 const BookmarkEditor::EditDetails& details, |
18 const base::string16& new_title, | 19 const base::string16& new_title, |
19 const GURL& new_url) { | 20 const GURL& new_url) { |
20 const BookmarkNode* node; | 21 const BookmarkNode* node; |
21 // When create the new one to right-clicked folder, add it to the next to the | 22 // When create the new one to right-clicked folder, add it to the next to the |
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
160 DCHECK(node); | 161 DCHECK(node); |
161 | 162 |
162 if (new_parent != node->parent()) | 163 if (new_parent != node->parent()) |
163 model->Move(node, new_parent, new_parent->child_count()); | 164 model->Move(node, new_parent, new_parent->child_count()); |
164 if (node->is_url()) | 165 if (node->is_url()) |
165 model->SetURL(node, new_url); | 166 model->SetURL(node, new_url); |
166 model->SetTitle(node, new_title); | 167 model->SetTitle(node, new_title); |
167 | 168 |
168 return node; | 169 return node; |
169 } | 170 } |
OLD | NEW |