Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(330)

Side by Side Diff: chrome/browser/ui/gtk/bookmarks/bookmark_tree_model.cc

Issue 7012005: Revert "Revert 84829 - Initial implementation of "Synced Bookmarks" folder." (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Trying to set .json eol-style Created 9 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/gtk/bookmarks/bookmark_tree_model.h" 5 #include "chrome/browser/ui/gtk/bookmarks/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 "base/utf_string_conversions.h" 10 #include "base/utf_string_conversions.h"
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
97 97
98 GtkTreeStore* MakeFolderTreeStore() { 98 GtkTreeStore* MakeFolderTreeStore() {
99 return gtk_tree_store_new(FOLDER_STORE_NUM_COLUMNS, GDK_TYPE_PIXBUF, 99 return gtk_tree_store_new(FOLDER_STORE_NUM_COLUMNS, GDK_TYPE_PIXBUF,
100 G_TYPE_STRING, G_TYPE_INT64, G_TYPE_BOOLEAN); 100 G_TYPE_STRING, G_TYPE_INT64, G_TYPE_BOOLEAN);
101 } 101 }
102 102
103 void AddToTreeStore(BookmarkModel* model, int64 selected_id, 103 void AddToTreeStore(BookmarkModel* model, int64 selected_id,
104 GtkTreeStore* store, GtkTreeIter* selected_iter) { 104 GtkTreeStore* store, GtkTreeIter* selected_iter) {
105 const BookmarkNode* root_node = model->root_node(); 105 const BookmarkNode* root_node = model->root_node();
106 for (int i = 0; i < root_node->child_count(); ++i) { 106 for (int i = 0; i < root_node->child_count(); ++i) {
107 AddToTreeStoreAt(root_node->GetChild(i), selected_id, store, selected_iter, 107 const BookmarkNode* child = root_node->GetChild(i);
108 NULL); 108 if (child->IsVisible()) {
109 AddToTreeStoreAt(child, selected_id, store, selected_iter, NULL);
110 }
109 } 111 }
110 } 112 }
111 113
112 GtkWidget* MakeTreeViewForStore(GtkTreeStore* store) { 114 GtkWidget* MakeTreeViewForStore(GtkTreeStore* store) {
113 GtkTreeViewColumn* column = gtk_tree_view_column_new(); 115 GtkTreeViewColumn* column = gtk_tree_view_column_new();
114 GtkCellRenderer* image_renderer = gtk_cell_renderer_pixbuf_new(); 116 GtkCellRenderer* image_renderer = gtk_cell_renderer_pixbuf_new();
115 gtk_tree_view_column_pack_start(column, image_renderer, FALSE); 117 gtk_tree_view_column_pack_start(column, image_renderer, FALSE);
116 gtk_tree_view_column_add_attribute(column, image_renderer, 118 gtk_tree_view_column_add_attribute(column, image_renderer,
117 "pixbuf", FOLDER_ICON); 119 "pixbuf", FOLDER_ICON);
118 GtkCellRenderer* text_renderer = gtk_cell_renderer_text_new(); 120 GtkCellRenderer* text_renderer = gtk_cell_renderer_text_new();
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
222 ret_val = UTF8ToUTF16(utf8str); 224 ret_val = UTF8ToUTF16(utf8str);
223 g_value_unset(&value); 225 g_value_unset(&value);
224 } else { 226 } else {
225 NOTREACHED() << "Impossible type mismatch"; 227 NOTREACHED() << "Impossible type mismatch";
226 } 228 }
227 229
228 return ret_val; 230 return ret_val;
229 } 231 }
230 232
231 } // namespace bookmark_utils 233 } // namespace bookmark_utils
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698