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

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

Issue 7012005: Revert "Revert 84829 - Initial implementation of "Synced Bookmarks" folder." (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix memory allocation of gtk iterator 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_editor_gtk.h" 5 #include "chrome/browser/ui/gtk/bookmarks/bookmark_editor_gtk.h"
6 6
7 #include <gtk/gtk.h> 7 #include <gtk/gtk.h>
8 8
9 #include "base/basictypes.h" 9 #include "base/basictypes.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 312 matching lines...) Expand 10 before | Expand all | Expand 10 after
323 tree_store_ = bookmark_utils::MakeFolderTreeStore(); 323 tree_store_ = bookmark_utils::MakeFolderTreeStore();
324 bookmark_utils::AddToTreeStore(bb_model_, selected_id, tree_store_, 324 bookmark_utils::AddToTreeStore(bb_model_, selected_id, tree_store_,
325 &selected_iter); 325 &selected_iter);
326 tree_view_ = bookmark_utils::MakeTreeViewForStore(tree_store_); 326 tree_view_ = bookmark_utils::MakeTreeViewForStore(tree_store_);
327 gtk_widget_set_size_request(tree_view_, kTreeWidth, kTreeHeight); 327 gtk_widget_set_size_request(tree_view_, kTreeWidth, kTreeHeight);
328 tree_selection_ = gtk_tree_view_get_selection(GTK_TREE_VIEW(tree_view_)); 328 tree_selection_ = gtk_tree_view_get_selection(GTK_TREE_VIEW(tree_view_));
329 g_signal_connect(tree_view_, "button-press-event", 329 g_signal_connect(tree_view_, "button-press-event",
330 G_CALLBACK(OnTreeViewButtonPressEventThunk), this); 330 G_CALLBACK(OnTreeViewButtonPressEventThunk), this);
331 331
332 GtkTreePath* path = NULL; 332 GtkTreePath* path = NULL;
333 if (selected_id) { 333 if (selected_id && selected_iter.user_data != NULL) {
Elliot Glaysher 2011/05/18 23:51:42 I don't understand this modified line. I don't see
Yaron 2011/05/19 00:05:14 It gets set within bookmark_utils::AddToTreeStore
334 path = gtk_tree_model_get_path(GTK_TREE_MODEL(tree_store_), 334 path = gtk_tree_model_get_path(GTK_TREE_MODEL(tree_store_),
335 &selected_iter); 335 &selected_iter);
336 } else { 336 } else {
337 // We don't have a selected parent (Probably because we're making a new 337 // We don't have a selected parent (Probably because we're making a new
338 // bookmark). Select the first item in the list. 338 // bookmark). Select the first item in the list.
339 path = gtk_tree_path_new_from_string("0"); 339 path = gtk_tree_path_new_from_string("0");
340 } 340 }
341 341
342 gtk_tree_view_expand_to_path(GTK_TREE_VIEW(tree_view_), path); 342 gtk_tree_view_expand_to_path(GTK_TREE_VIEW(tree_view_), path);
343 gtk_tree_selection_select_path(tree_selection_, path); 343 gtk_tree_selection_select_path(tree_selection_, path);
(...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after
575 GTK_TREE_MODEL(tree_store_), &new_item_iter); 575 GTK_TREE_MODEL(tree_store_), &new_item_iter);
576 gtk_tree_view_expand_to_path(GTK_TREE_VIEW(tree_view_), path); 576 gtk_tree_view_expand_to_path(GTK_TREE_VIEW(tree_view_), path);
577 577
578 // Make the folder name editable. 578 // Make the folder name editable.
579 gtk_tree_view_set_cursor(GTK_TREE_VIEW(tree_view_), path, 579 gtk_tree_view_set_cursor(GTK_TREE_VIEW(tree_view_), path,
580 gtk_tree_view_get_column(GTK_TREE_VIEW(tree_view_), 0), 580 gtk_tree_view_get_column(GTK_TREE_VIEW(tree_view_), 0),
581 TRUE); 581 TRUE);
582 582
583 gtk_tree_path_free(path); 583 gtk_tree_path_free(path);
584 } 584 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698