OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/gtk/bookmark_tree_model.h" | 5 #include "chrome/browser/gtk/bookmark_tree_model.h" |
6 | 6 |
7 #include <gtk/gtk.h> | 7 #include <gtk/gtk.h> |
8 | 8 |
9 #include "base/string_util.h" | 9 #include "base/string_util.h" |
10 #include "chrome/browser/bookmarks/bookmark_model.h" | 10 #include "chrome/browser/bookmarks/bookmark_model.h" |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
59 // Existing node, reset the title (BBModel ignores changes if the title | 59 // Existing node, reset the title (BBModel ignores changes if the title |
60 // is the same). | 60 // is the same). |
61 for (int j = 0; j < bb_node->GetChildCount(); ++j) { | 61 for (int j = 0; j < bb_node->GetChildCount(); ++j) { |
62 const BookmarkNode* node = bb_node->GetChild(j); | 62 const BookmarkNode* node = bb_node->GetChild(j); |
63 if (node->is_folder() && node->id() == id) { | 63 if (node->is_folder() && node->id() == id) { |
64 child_bb_node = node; | 64 child_bb_node = node; |
65 break; | 65 break; |
66 } | 66 } |
67 } | 67 } |
68 DCHECK(child_bb_node); | 68 DCHECK(child_bb_node); |
69 bb_model->SetTitle(child_bb_node, UTF16ToWide(title)); | 69 bb_model->SetTitle(child_bb_node, title); |
70 } | 70 } |
71 RecursiveResolve(bb_model, child_bb_node, | 71 RecursiveResolve(bb_model, child_bb_node, |
72 tree_model, &child_iter, | 72 tree_model, &child_iter, |
73 selected_path, selected_node); | 73 selected_path, selected_node); |
74 } while (gtk_tree_model_iter_next(tree_model, &child_iter)); | 74 } while (gtk_tree_model_iter_next(tree_model, &child_iter)); |
75 } | 75 } |
76 } | 76 } |
77 | 77 |
78 // Update the folder name in the GtkTreeStore. | 78 // Update the folder name in the GtkTreeStore. |
79 void OnFolderNameEdited(GtkCellRendererText* render, | 79 void OnFolderNameEdited(GtkCellRendererText* render, |
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
220 ret_val = UTF8ToUTF16(utf8str); | 220 ret_val = UTF8ToUTF16(utf8str); |
221 g_value_unset(&value); | 221 g_value_unset(&value); |
222 } else { | 222 } else { |
223 NOTREACHED() << "Impossible type mismatch"; | 223 NOTREACHED() << "Impossible type mismatch"; |
224 } | 224 } |
225 | 225 |
226 return ret_val; | 226 return ret_val; |
227 } | 227 } |
228 | 228 |
229 } // namespace bookmark_utils | 229 } // namespace bookmark_utils |
OLD | NEW |