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