| 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 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 145 l10n_util::GetStringUTF8(IDS_BOOMARK_EDITOR_NAME_LABEL).c_str(), | 145 l10n_util::GetStringUTF8(IDS_BOOMARK_EDITOR_NAME_LABEL).c_str(), |
| 146 name_entry_, | 146 name_entry_, |
| 147 l10n_util::GetStringUTF8(IDS_BOOMARK_EDITOR_URL_LABEL).c_str(), | 147 l10n_util::GetStringUTF8(IDS_BOOMARK_EDITOR_URL_LABEL).c_str(), |
| 148 url_entry_, | 148 url_entry_, |
| 149 NULL); | 149 NULL); |
| 150 | 150 |
| 151 gtk_box_pack_start(GTK_BOX(vbox), table, FALSE, FALSE, 0); | 151 gtk_box_pack_start(GTK_BOX(vbox), table, FALSE, FALSE, 0); |
| 152 | 152 |
| 153 if (show_tree_) { | 153 if (show_tree_) { |
| 154 GtkTreeIter selected_iter; | 154 GtkTreeIter selected_iter; |
| 155 int selected_id = node_ ? node_->GetParent()->id() : 0; | 155 int64 selected_id = node_ ? node_->GetParent()->id() : 0; |
| 156 tree_store_ = bookmark_utils::MakeFolderTreeStore(); | 156 tree_store_ = bookmark_utils::MakeFolderTreeStore(); |
| 157 bookmark_utils::AddToTreeStore(bb_model_, selected_id, | 157 bookmark_utils::AddToTreeStore(bb_model_, selected_id, |
| 158 tree_store_, &selected_iter); | 158 tree_store_, &selected_iter); |
| 159 | 159 |
| 160 GtkTreeViewColumn* icon_column = | 160 GtkTreeViewColumn* icon_column = |
| 161 gtk_tree_view_column_new_with_attributes( | 161 gtk_tree_view_column_new_with_attributes( |
| 162 "", gtk_cell_renderer_pixbuf_new(), "pixbuf", | 162 "", gtk_cell_renderer_pixbuf_new(), "pixbuf", |
| 163 bookmark_utils::FOLDER_ICON, NULL); | 163 bookmark_utils::FOLDER_ICON, NULL); |
| 164 GtkTreeViewColumn* name_column = | 164 GtkTreeViewColumn* name_column = |
| 165 gtk_tree_view_column_new_with_attributes( | 165 gtk_tree_view_column_new_with_attributes( |
| (...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 321 } | 321 } |
| 322 | 322 |
| 323 void BookmarkEditorGtk::AddNewGroup(GtkTreeIter* parent, GtkTreeIter* child) { | 323 void BookmarkEditorGtk::AddNewGroup(GtkTreeIter* parent, GtkTreeIter* child) { |
| 324 gtk_tree_store_append(tree_store_, child, parent); | 324 gtk_tree_store_append(tree_store_, child, parent); |
| 325 gtk_tree_store_set( | 325 gtk_tree_store_set( |
| 326 tree_store_, child, | 326 tree_store_, child, |
| 327 bookmark_utils::FOLDER_ICON, | 327 bookmark_utils::FOLDER_ICON, |
| 328 bookmark_utils::GetFolderIcon(), | 328 bookmark_utils::GetFolderIcon(), |
| 329 bookmark_utils::FOLDER_NAME, | 329 bookmark_utils::FOLDER_NAME, |
| 330 l10n_util::GetStringUTF8(IDS_BOOMARK_EDITOR_NEW_FOLDER_NAME).c_str(), | 330 l10n_util::GetStringUTF8(IDS_BOOMARK_EDITOR_NEW_FOLDER_NAME).c_str(), |
| 331 bookmark_utils::ITEM_ID, 0, | 331 bookmark_utils::ITEM_ID, static_cast<int64>(0), |
| 332 -1); | 332 -1); |
| 333 } | 333 } |
| 334 | 334 |
| 335 // static | 335 // static |
| 336 void BookmarkEditorGtk::OnResponse(GtkDialog* dialog, int response_id, | 336 void BookmarkEditorGtk::OnResponse(GtkDialog* dialog, int response_id, |
| 337 BookmarkEditorGtk* window) { | 337 BookmarkEditorGtk* window) { |
| 338 if (response_id == GTK_RESPONSE_ACCEPT) { | 338 if (response_id == GTK_RESPONSE_ACCEPT) { |
| 339 window->ApplyEdits(); | 339 window->ApplyEdits(); |
| 340 } | 340 } |
| 341 | 341 |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 391 | 391 |
| 392 GtkTreeIter new_item_iter; | 392 GtkTreeIter new_item_iter; |
| 393 dialog->AddNewGroup(&iter, &new_item_iter); | 393 dialog->AddNewGroup(&iter, &new_item_iter); |
| 394 | 394 |
| 395 GtkTreePath* path = gtk_tree_model_get_path( | 395 GtkTreePath* path = gtk_tree_model_get_path( |
| 396 GTK_TREE_MODEL(dialog->tree_store_), &new_item_iter); | 396 GTK_TREE_MODEL(dialog->tree_store_), &new_item_iter); |
| 397 gtk_tree_view_expand_to_path(GTK_TREE_VIEW(dialog->tree_view_), path); | 397 gtk_tree_view_expand_to_path(GTK_TREE_VIEW(dialog->tree_view_), path); |
| 398 gtk_tree_selection_select_path(dialog->tree_selection_, path); | 398 gtk_tree_selection_select_path(dialog->tree_selection_, path); |
| 399 gtk_tree_path_free(path); | 399 gtk_tree_path_free(path); |
| 400 } | 400 } |
| OLD | NEW |