| 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" |
| 11 #include "base/logging.h" | 11 #include "base/logging.h" |
| 12 #include "base/string_util.h" | 12 #include "base/string_util.h" |
| 13 #include "base/utf_string_conversions.h" | 13 #include "base/utf_string_conversions.h" |
| 14 #include "chrome/browser/bookmarks/bookmark_expanded_state_tracker.h" | 14 #include "chrome/browser/bookmarks/bookmark_expanded_state_tracker.h" |
| 15 #include "chrome/browser/bookmarks/bookmark_model.h" | 15 #include "chrome/browser/bookmarks/bookmark_model.h" |
| 16 #include "chrome/browser/bookmarks/bookmark_utils.h" | 16 #include "chrome/browser/bookmarks/bookmark_utils.h" |
| 17 #include "chrome/browser/history/history.h" | 17 #include "chrome/browser/history/history.h" |
| 18 #include "chrome/browser/net/url_fixer_upper.h" | 18 #include "chrome/browser/net/url_fixer_upper.h" |
| 19 #include "chrome/browser/profiles/profile.h" | 19 #include "chrome/browser/profiles/profile.h" |
| 20 #include "chrome/browser/ui/gtk/bookmarks/bookmark_tree_model.h" | 20 #include "chrome/browser/ui/gtk/bookmarks/bookmark_tree_model.h" |
| 21 #include "chrome/browser/ui/gtk/bookmarks/bookmark_utils_gtk.h" | 21 #include "chrome/browser/ui/gtk/bookmarks/bookmark_utils_gtk.h" |
| 22 #include "chrome/browser/ui/gtk/gtk_theme_service.h" | 22 #include "chrome/browser/ui/gtk/gtk_theme_service.h" |
| 23 #include "chrome/browser/ui/gtk/gtk_util.h" | 23 #include "chrome/browser/ui/gtk/gtk_util.h" |
| 24 #include "googleurl/src/gurl.h" | 24 #include "googleurl/src/gurl.h" |
| 25 #include "grit/chromium_strings.h" | 25 #include "grit/chromium_strings.h" |
| 26 #include "grit/generated_resources.h" | 26 #include "grit/generated_resources.h" |
| 27 #include "grit/locale_settings.h" | 27 #include "grit/locale_settings.h" |
| 28 #include "ui/base/gtk/gtk_hig_constants.h" | |
| 29 #include "ui/base/l10n/l10n_util.h" | 28 #include "ui/base/l10n/l10n_util.h" |
| 30 #include "ui/base/models/simple_menu_model.h" | 29 #include "ui/base/models/simple_menu_model.h" |
| 31 #include "ui/gfx/gtk_util.h" | 30 #include "ui/gfx/gtk_util.h" |
| 32 #include "ui/gfx/point.h" | 31 #include "ui/gfx/point.h" |
| 33 | 32 |
| 34 #if defined(TOOLKIT_VIEWS) | 33 #if defined(TOOLKIT_VIEWS) |
| 35 #include "views/controls/menu/menu_2.h" | 34 #include "views/controls/menu/menu_2.h" |
| 36 #else | 35 #else |
| 37 #include "chrome/browser/ui/gtk/menu_gtk.h" | 36 #include "chrome/browser/ui/gtk/menu_gtk.h" |
| 38 #endif | 37 #endif |
| (...skipping 299 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 338 // |||| |||| | 337 // |||| |||| |
| 339 // |||| |||| | 338 // |||| |||| |
| 340 // |||| |||| | 339 // |||| |||| |
| 341 // |||+---------------------------------------------------------+||| | 340 // |||+---------------------------------------------------------+||| |
| 342 // ||+-----------------------------------------------------------+|| | 341 // ||+-----------------------------------------------------------+|| |
| 343 // |+-------------------------------------------------------------+| | 342 // |+-------------------------------------------------------------+| |
| 344 // +---------------------------------------------------------------+ | 343 // +---------------------------------------------------------------+ |
| 345 // | 344 // |
| 346 // * The url and corresponding label are not shown if creating a new folder. | 345 // * The url and corresponding label are not shown if creating a new folder. |
| 347 GtkWidget* content_area = gtk_dialog_get_content_area(GTK_DIALOG(dialog_)); | 346 GtkWidget* content_area = gtk_dialog_get_content_area(GTK_DIALOG(dialog_)); |
| 348 gtk_box_set_spacing(GTK_BOX(content_area), ui::kContentAreaSpacing); | 347 gtk_box_set_spacing(GTK_BOX(content_area), gtk_util::kContentAreaSpacing); |
| 349 | 348 |
| 350 GtkWidget* vbox = gtk_vbox_new(FALSE, 12); | 349 GtkWidget* vbox = gtk_vbox_new(FALSE, 12); |
| 351 | 350 |
| 352 name_entry_ = gtk_entry_new(); | 351 name_entry_ = gtk_entry_new(); |
| 353 std::string title; | 352 std::string title; |
| 354 GURL url; | 353 GURL url; |
| 355 if (details_.type == EditDetails::EXISTING_NODE) { | 354 if (details_.type == EditDetails::EXISTING_NODE) { |
| 356 title = UTF16ToUTF8(details_.existing_node->GetTitle()); | 355 title = UTF16ToUTF8(details_.existing_node->GetTitle()); |
| 357 url = details_.existing_node->url(); | 356 url = details_.existing_node->url(); |
| 358 } else if (details_.type == EditDetails::NEW_FOLDER) { | 357 } else if (details_.type == EditDetails::NEW_FOLDER) { |
| (...skipping 321 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 680 GTK_TREE_MODEL(tree_store_), &new_item_iter); | 679 GTK_TREE_MODEL(tree_store_), &new_item_iter); |
| 681 gtk_tree_view_expand_to_path(GTK_TREE_VIEW(tree_view_), path); | 680 gtk_tree_view_expand_to_path(GTK_TREE_VIEW(tree_view_), path); |
| 682 | 681 |
| 683 // Make the folder name editable. | 682 // Make the folder name editable. |
| 684 gtk_tree_view_set_cursor(GTK_TREE_VIEW(tree_view_), path, | 683 gtk_tree_view_set_cursor(GTK_TREE_VIEW(tree_view_), path, |
| 685 gtk_tree_view_get_column(GTK_TREE_VIEW(tree_view_), 0), | 684 gtk_tree_view_get_column(GTK_TREE_VIEW(tree_view_), 0), |
| 686 TRUE); | 685 TRUE); |
| 687 | 686 |
| 688 gtk_tree_path_free(path); | 687 gtk_tree_path_free(path); |
| 689 } | 688 } |
| OLD | NEW |