| 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 <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "chrome/grit/generated_resources.h" | 10 #include "chrome/grit/generated_resources.h" |
| (...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 117 | 117 |
| 118 BookmarkEditor::EditDetails BookmarkEditor::EditDetails::AddFolder( | 118 BookmarkEditor::EditDetails BookmarkEditor::EditDetails::AddFolder( |
| 119 const BookmarkNode* parent_node, | 119 const BookmarkNode* parent_node, |
| 120 int index) { | 120 int index) { |
| 121 EditDetails details(NEW_FOLDER); | 121 EditDetails details(NEW_FOLDER); |
| 122 details.parent_node = parent_node; | 122 details.parent_node = parent_node; |
| 123 details.index = index; | 123 details.index = index; |
| 124 return details; | 124 return details; |
| 125 } | 125 } |
| 126 | 126 |
| 127 BookmarkEditor::EditDetails::EditDetails(const EditDetails& other) = default; |
| 128 |
| 127 BookmarkEditor::EditDetails::~EditDetails() {} | 129 BookmarkEditor::EditDetails::~EditDetails() {} |
| 128 | 130 |
| 129 // static | 131 // static |
| 130 const BookmarkNode* BookmarkEditor::ApplyEditsWithNoFolderChange( | 132 const BookmarkNode* BookmarkEditor::ApplyEditsWithNoFolderChange( |
| 131 BookmarkModel* model, | 133 BookmarkModel* model, |
| 132 const BookmarkNode* parent, | 134 const BookmarkNode* parent, |
| 133 const EditDetails& details, | 135 const EditDetails& details, |
| 134 const base::string16& new_title, | 136 const base::string16& new_title, |
| 135 const GURL& new_url) { | 137 const GURL& new_url) { |
| 136 if (details.type == EditDetails::NEW_URL || | 138 if (details.type == EditDetails::NEW_URL || |
| (...skipping 27 matching lines...) Expand all Loading... |
| 164 DCHECK(node); | 166 DCHECK(node); |
| 165 | 167 |
| 166 if (new_parent != node->parent()) | 168 if (new_parent != node->parent()) |
| 167 model->Move(node, new_parent, new_parent->child_count()); | 169 model->Move(node, new_parent, new_parent->child_count()); |
| 168 if (node->is_url()) | 170 if (node->is_url()) |
| 169 model->SetURL(node, new_url); | 171 model->SetURL(node, new_url); |
| 170 model->SetTitle(node, new_title); | 172 model->SetTitle(node, new_title); |
| 171 | 173 |
| 172 return node; | 174 return node; |
| 173 } | 175 } |
| OLD | NEW |