| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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_editor_gtk.h" | 5 #include "chrome/browser/gtk/bookmark_editor_gtk.h" |
| 6 | 6 |
| 7 #include <gtk/gtk.h> | 7 #include <gtk/gtk.h> |
| 8 | 8 |
| 9 #include "app/l10n_util.h" | 9 #include "app/l10n_util.h" |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| (...skipping 295 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 306 | 306 |
| 307 bookmark_utils::ApplyEditsWithPossibleGroupChange( | 307 bookmark_utils::ApplyEditsWithPossibleGroupChange( |
| 308 bb_model_, new_parent, node_, new_title, new_url, handler_.get()); | 308 bb_model_, new_parent, node_, new_title, new_url, handler_.get()); |
| 309 } | 309 } |
| 310 | 310 |
| 311 void BookmarkEditorGtk::AddNewGroup(GtkTreeIter* parent, GtkTreeIter* child) { | 311 void BookmarkEditorGtk::AddNewGroup(GtkTreeIter* parent, GtkTreeIter* child) { |
| 312 gtk_tree_store_append(tree_store_, child, parent); | 312 gtk_tree_store_append(tree_store_, child, parent); |
| 313 gtk_tree_store_set( | 313 gtk_tree_store_set( |
| 314 tree_store_, child, | 314 tree_store_, child, |
| 315 bookmark_utils::FOLDER_ICON, | 315 bookmark_utils::FOLDER_ICON, |
| 316 bookmark_utils::GetFolderIcon(), | 316 bookmark_utils::GetFolderIcon(true), |
| 317 bookmark_utils::FOLDER_NAME, | 317 bookmark_utils::FOLDER_NAME, |
| 318 l10n_util::GetStringUTF8(IDS_BOOMARK_EDITOR_NEW_FOLDER_NAME).c_str(), | 318 l10n_util::GetStringUTF8(IDS_BOOMARK_EDITOR_NEW_FOLDER_NAME).c_str(), |
| 319 bookmark_utils::ITEM_ID, static_cast<int64>(0), | 319 bookmark_utils::ITEM_ID, static_cast<int64>(0), |
| 320 -1); | 320 -1); |
| 321 } | 321 } |
| 322 | 322 |
| 323 // static | 323 // static |
| 324 void BookmarkEditorGtk::OnSelectionChanged(GtkTreeSelection* selection, | 324 void BookmarkEditorGtk::OnSelectionChanged(GtkTreeSelection* selection, |
| 325 BookmarkEditorGtk* dialog) { | 325 BookmarkEditorGtk* dialog) { |
| 326 if (!gtk_tree_selection_get_selected(dialog->tree_selection_, NULL, NULL)) | 326 if (!gtk_tree_selection_get_selected(dialog->tree_selection_, NULL, NULL)) |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 389 | 389 |
| 390 GtkTreeIter new_item_iter; | 390 GtkTreeIter new_item_iter; |
| 391 dialog->AddNewGroup(&iter, &new_item_iter); | 391 dialog->AddNewGroup(&iter, &new_item_iter); |
| 392 | 392 |
| 393 GtkTreePath* path = gtk_tree_model_get_path( | 393 GtkTreePath* path = gtk_tree_model_get_path( |
| 394 GTK_TREE_MODEL(dialog->tree_store_), &new_item_iter); | 394 GTK_TREE_MODEL(dialog->tree_store_), &new_item_iter); |
| 395 gtk_tree_view_expand_to_path(GTK_TREE_VIEW(dialog->tree_view_), path); | 395 gtk_tree_view_expand_to_path(GTK_TREE_VIEW(dialog->tree_view_), path); |
| 396 gtk_tree_selection_select_path(dialog->tree_selection_, path); | 396 gtk_tree_selection_select_path(dialog->tree_selection_, path); |
| 397 gtk_tree_path_free(path); | 397 gtk_tree_path_free(path); |
| 398 } | 398 } |
| OLD | NEW |