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 601 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
612 GdkEvent* event) { | 612 GdkEvent* event) { |
613 Close(); | 613 Close(); |
614 | 614 |
615 // Return true to prevent the gtk dialog from being destroyed. Close will | 615 // Return true to prevent the gtk dialog from being destroyed. Close will |
616 // destroy it for us and the default gtk_dialog_delete_event_handler() will | 616 // destroy it for us and the default gtk_dialog_delete_event_handler() will |
617 // force the destruction without us being able to stop it. | 617 // force the destruction without us being able to stop it. |
618 return TRUE; | 618 return TRUE; |
619 } | 619 } |
620 | 620 |
621 void BookmarkEditorGtk::OnWindowDestroy(GtkWidget* widget) { | 621 void BookmarkEditorGtk::OnWindowDestroy(GtkWidget* widget) { |
622 MessageLoop::current()->DeleteSoon(FROM_HERE, this); | 622 base::MessageLoop::current()->DeleteSoon(FROM_HERE, this); |
623 } | 623 } |
624 | 624 |
625 void BookmarkEditorGtk::OnEntryChanged(GtkWidget* entry) { | 625 void BookmarkEditorGtk::OnEntryChanged(GtkWidget* entry) { |
626 gboolean can_close = TRUE; | 626 gboolean can_close = TRUE; |
627 if (details_.GetNodeType() != BookmarkNode::FOLDER) { | 627 if (details_.GetNodeType() != BookmarkNode::FOLDER) { |
628 if (GetInputURL().is_valid()) { | 628 if (GetInputURL().is_valid()) { |
629 gtk_widget_modify_base(url_entry_, GTK_STATE_NORMAL, NULL); | 629 gtk_widget_modify_base(url_entry_, GTK_STATE_NORMAL, NULL); |
630 } else { | 630 } else { |
631 gtk_widget_modify_base(url_entry_, GTK_STATE_NORMAL, &kErrorColor); | 631 gtk_widget_modify_base(url_entry_, GTK_STATE_NORMAL, &kErrorColor); |
632 can_close = FALSE; | 632 can_close = FALSE; |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
669 GTK_TREE_MODEL(tree_store_), &new_item_iter); | 669 GTK_TREE_MODEL(tree_store_), &new_item_iter); |
670 gtk_tree_view_expand_to_path(GTK_TREE_VIEW(tree_view_), path); | 670 gtk_tree_view_expand_to_path(GTK_TREE_VIEW(tree_view_), path); |
671 | 671 |
672 // Make the folder name editable. | 672 // Make the folder name editable. |
673 gtk_tree_view_set_cursor(GTK_TREE_VIEW(tree_view_), path, | 673 gtk_tree_view_set_cursor(GTK_TREE_VIEW(tree_view_), path, |
674 gtk_tree_view_get_column(GTK_TREE_VIEW(tree_view_), 0), | 674 gtk_tree_view_get_column(GTK_TREE_VIEW(tree_view_), 0), |
675 TRUE); | 675 TRUE); |
676 | 676 |
677 gtk_tree_path_free(path); | 677 gtk_tree_path_free(path); |
678 } | 678 } |
OLD | NEW |