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 300 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
338 // |||| |||| | 339 // |||| |||| |
339 // |||| |||| | 340 // |||| |||| |
340 // |||| |||| | 341 // |||| |||| |
341 // |||+---------------------------------------------------------+||| | 342 // |||+---------------------------------------------------------+||| |
342 // ||+-----------------------------------------------------------+|| | 343 // ||+-----------------------------------------------------------+|| |
343 // |+-------------------------------------------------------------+| | 344 // |+-------------------------------------------------------------+| |
344 // +---------------------------------------------------------------+ | 345 // +---------------------------------------------------------------+ |
345 // | 346 // |
346 // * The url and corresponding label are not shown if creating a new folder. | 347 // * 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_)); | 348 GtkWidget* content_area = gtk_dialog_get_content_area(GTK_DIALOG(dialog_)); |
348 gtk_box_set_spacing(GTK_BOX(content_area), gtk_util::kContentAreaSpacing); | 349 gtk_box_set_spacing(GTK_BOX(content_area), ui::kContentAreaSpacing); |
349 | 350 |
350 GtkWidget* vbox = gtk_vbox_new(FALSE, 12); | 351 GtkWidget* vbox = gtk_vbox_new(FALSE, 12); |
351 | 352 |
352 name_entry_ = gtk_entry_new(); | 353 name_entry_ = gtk_entry_new(); |
353 std::string title; | 354 std::string title; |
354 GURL url; | 355 GURL url; |
355 if (details_.type == EditDetails::EXISTING_NODE) { | 356 if (details_.type == EditDetails::EXISTING_NODE) { |
356 title = UTF16ToUTF8(details_.existing_node->GetTitle()); | 357 title = UTF16ToUTF8(details_.existing_node->GetTitle()); |
357 url = details_.existing_node->url(); | 358 url = details_.existing_node->url(); |
358 } else if (details_.type == EditDetails::NEW_FOLDER) { | 359 } 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); | 681 GTK_TREE_MODEL(tree_store_), &new_item_iter); |
681 gtk_tree_view_expand_to_path(GTK_TREE_VIEW(tree_view_), path); | 682 gtk_tree_view_expand_to_path(GTK_TREE_VIEW(tree_view_), path); |
682 | 683 |
683 // Make the folder name editable. | 684 // Make the folder name editable. |
684 gtk_tree_view_set_cursor(GTK_TREE_VIEW(tree_view_), path, | 685 gtk_tree_view_set_cursor(GTK_TREE_VIEW(tree_view_), path, |
685 gtk_tree_view_get_column(GTK_TREE_VIEW(tree_view_), 0), | 686 gtk_tree_view_get_column(GTK_TREE_VIEW(tree_view_), 0), |
686 TRUE); | 687 TRUE); |
687 | 688 |
688 gtk_tree_path_free(path); | 689 gtk_tree_path_free(path); |
689 } | 690 } |
OLD | NEW |