| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 <set> | 9 #include <set> |
| 10 | 10 |
| (...skipping 556 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 567 // Remove the folders that were removed. This has to be done after all the | 567 // Remove the folders that were removed. This has to be done after all the |
| 568 // other changes have been committed. | 568 // other changes have been committed. |
| 569 bookmark_utils::DeleteBookmarkFolders(bb_model_, deletes_); | 569 bookmark_utils::DeleteBookmarkFolders(bb_model_, deletes_); |
| 570 } | 570 } |
| 571 | 571 |
| 572 void BookmarkEditorGtk::AddNewFolder(GtkTreeIter* parent, GtkTreeIter* child) { | 572 void BookmarkEditorGtk::AddNewFolder(GtkTreeIter* parent, GtkTreeIter* child) { |
| 573 gtk_tree_store_append(tree_store_, child, parent); | 573 gtk_tree_store_append(tree_store_, child, parent); |
| 574 gtk_tree_store_set( | 574 gtk_tree_store_set( |
| 575 tree_store_, child, | 575 tree_store_, child, |
| 576 bookmark_utils::FOLDER_ICON, | 576 bookmark_utils::FOLDER_ICON, |
| 577 GtkThemeService::GetFolderIcon(true)->ToGdkPixbuf(), | 577 GtkThemeService::GetFolderIcon(true).ToGdkPixbuf(), |
| 578 bookmark_utils::FOLDER_NAME, | 578 bookmark_utils::FOLDER_NAME, |
| 579 l10n_util::GetStringUTF8(IDS_BOOKMARK_EDITOR_NEW_FOLDER_NAME).c_str(), | 579 l10n_util::GetStringUTF8(IDS_BOOKMARK_EDITOR_NEW_FOLDER_NAME).c_str(), |
| 580 bookmark_utils::ITEM_ID, static_cast<int64>(0), | 580 bookmark_utils::ITEM_ID, static_cast<int64>(0), |
| 581 bookmark_utils::IS_EDITABLE, TRUE, | 581 bookmark_utils::IS_EDITABLE, TRUE, |
| 582 -1); | 582 -1); |
| 583 } | 583 } |
| 584 | 584 |
| 585 void BookmarkEditorGtk::OnSelectionChanged(GtkWidget* selection) { | 585 void BookmarkEditorGtk::OnSelectionChanged(GtkWidget* selection) { |
| 586 if (!gtk_tree_selection_get_selected(tree_selection_, NULL, NULL)) | 586 if (!gtk_tree_selection_get_selected(tree_selection_, NULL, NULL)) |
| 587 gtk_widget_set_sensitive(new_folder_button_, FALSE); | 587 gtk_widget_set_sensitive(new_folder_button_, FALSE); |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 657 GTK_TREE_MODEL(tree_store_), &new_item_iter); | 657 GTK_TREE_MODEL(tree_store_), &new_item_iter); |
| 658 gtk_tree_view_expand_to_path(GTK_TREE_VIEW(tree_view_), path); | 658 gtk_tree_view_expand_to_path(GTK_TREE_VIEW(tree_view_), path); |
| 659 | 659 |
| 660 // Make the folder name editable. | 660 // Make the folder name editable. |
| 661 gtk_tree_view_set_cursor(GTK_TREE_VIEW(tree_view_), path, | 661 gtk_tree_view_set_cursor(GTK_TREE_VIEW(tree_view_), path, |
| 662 gtk_tree_view_get_column(GTK_TREE_VIEW(tree_view_), 0), | 662 gtk_tree_view_get_column(GTK_TREE_VIEW(tree_view_), 0), |
| 663 TRUE); | 663 TRUE); |
| 664 | 664 |
| 665 gtk_tree_path_free(path); | 665 gtk_tree_path_free(path); |
| 666 } | 666 } |
| OLD | NEW |