| OLD | NEW |
| 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 #include <set> | 8 #include <set> |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| (...skipping 288 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 299 DCHECK(bb_model_); | 299 DCHECK(bb_model_); |
| 300 bb_model_->AddObserver(this); | 300 bb_model_->AddObserver(this); |
| 301 | 301 |
| 302 dialog_ = gtk_dialog_new_with_buttons( | 302 dialog_ = gtk_dialog_new_with_buttons( |
| 303 l10n_util::GetStringUTF8(IDS_BOOKMARK_EDITOR_TITLE).c_str(), | 303 l10n_util::GetStringUTF8(IDS_BOOKMARK_EDITOR_TITLE).c_str(), |
| 304 parent_window, | 304 parent_window, |
| 305 GTK_DIALOG_MODAL, | 305 GTK_DIALOG_MODAL, |
| 306 GTK_STOCK_CANCEL, GTK_RESPONSE_REJECT, | 306 GTK_STOCK_CANCEL, GTK_RESPONSE_REJECT, |
| 307 GTK_STOCK_SAVE, GTK_RESPONSE_ACCEPT, | 307 GTK_STOCK_SAVE, GTK_RESPONSE_ACCEPT, |
| 308 NULL); | 308 NULL); |
| 309 #if !GTK_CHECK_VERSION(2, 22, 0) |
| 309 gtk_dialog_set_has_separator(GTK_DIALOG(dialog_), FALSE); | 310 gtk_dialog_set_has_separator(GTK_DIALOG(dialog_), FALSE); |
| 311 #endif |
| 310 | 312 |
| 311 if (show_tree_) { | 313 if (show_tree_) { |
| 312 GtkWidget* action_area = GTK_DIALOG(dialog_)->action_area; | 314 GtkWidget* action_area = GTK_DIALOG(dialog_)->action_area; |
| 313 new_folder_button_ = gtk_button_new_with_label( | 315 new_folder_button_ = gtk_button_new_with_label( |
| 314 l10n_util::GetStringUTF8( | 316 l10n_util::GetStringUTF8( |
| 315 IDS_BOOKMARK_EDITOR_NEW_FOLDER_BUTTON).c_str()); | 317 IDS_BOOKMARK_EDITOR_NEW_FOLDER_BUTTON).c_str()); |
| 316 g_signal_connect(new_folder_button_, "clicked", | 318 g_signal_connect(new_folder_button_, "clicked", |
| 317 G_CALLBACK(OnNewFolderClickedThunk), this); | 319 G_CALLBACK(OnNewFolderClickedThunk), this); |
| 318 gtk_container_add(GTK_CONTAINER(action_area), new_folder_button_); | 320 gtk_container_add(GTK_CONTAINER(action_area), new_folder_button_); |
| 319 gtk_button_box_set_child_secondary(GTK_BUTTON_BOX(action_area), | 321 gtk_button_box_set_child_secondary(GTK_BUTTON_BOX(action_area), |
| (...skipping 363 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 683 GTK_TREE_MODEL(tree_store_), &new_item_iter); | 685 GTK_TREE_MODEL(tree_store_), &new_item_iter); |
| 684 gtk_tree_view_expand_to_path(GTK_TREE_VIEW(tree_view_), path); | 686 gtk_tree_view_expand_to_path(GTK_TREE_VIEW(tree_view_), path); |
| 685 | 687 |
| 686 // Make the folder name editable. | 688 // Make the folder name editable. |
| 687 gtk_tree_view_set_cursor(GTK_TREE_VIEW(tree_view_), path, | 689 gtk_tree_view_set_cursor(GTK_TREE_VIEW(tree_view_), path, |
| 688 gtk_tree_view_get_column(GTK_TREE_VIEW(tree_view_), 0), | 690 gtk_tree_view_get_column(GTK_TREE_VIEW(tree_view_), 0), |
| 689 TRUE); | 691 TRUE); |
| 690 | 692 |
| 691 gtk_tree_path_free(path); | 693 gtk_tree_path_free(path); |
| 692 } | 694 } |
| OLD | NEW |