| 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/views/bookmarks/bookmark_editor_view.h" | 5 #include "chrome/browser/ui/views/bookmarks/bookmark_editor_view.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/strings/string_util.h" | 10 #include "base/strings/string_util.h" |
| 11 #include "base/strings/utf_string_conversions.h" | 11 #include "base/strings/utf_string_conversions.h" |
| 12 #include "chrome/browser/bookmarks/bookmark_model_factory.h" | 12 #include "chrome/browser/bookmarks/bookmark_model_factory.h" |
| 13 #include "chrome/browser/profiles/profile.h" | 13 #include "chrome/browser/profiles/profile.h" |
| 14 #include "chrome/browser/ui/bookmarks/bookmark_utils.h" | 14 #include "chrome/browser/ui/bookmarks/bookmark_utils.h" |
| 15 #include "chrome/browser/ui/bookmarks/bookmark_utils_desktop.h" | 15 #include "chrome/browser/ui/bookmarks/bookmark_utils_desktop.h" |
| 16 #include "chrome/browser/ui/browser_dialogs.h" | 16 #include "chrome/browser/ui/browser_dialogs.h" |
| 17 #include "chrome/grit/generated_resources.h" | 17 #include "chrome/grit/generated_resources.h" |
| 18 #include "chrome/grit/locale_settings.h" | 18 #include "chrome/grit/locale_settings.h" |
| 19 #include "components/bookmarks/browser/bookmark_model.h" | 19 #include "components/bookmarks/browser/bookmark_model.h" |
| 20 #include "components/bookmarks/browser/bookmark_utils.h" | 20 #include "components/bookmarks/browser/bookmark_utils.h" |
| 21 #include "components/constrained_window/constrained_window_views.h" | 21 #include "components/constrained_window/constrained_window_views.h" |
| 22 #include "components/history/core/browser/history_service.h" | 22 #include "components/history/core/browser/history_service.h" |
| 23 #include "components/url_formatter/url_fixer.h" | 23 #include "components/url_formatter/url_fixer.h" |
| 24 #include "components/user_prefs/user_prefs.h" | 24 #include "components/user_prefs/user_prefs.h" |
| 25 #include "grit/components_strings.h" | 25 #include "grit/components_strings.h" |
| 26 #include "ui/accessibility/ax_view_state.h" | 26 #include "ui/accessibility/ax_view_state.h" |
| 27 #include "ui/base/l10n/l10n_util.h" | 27 #include "ui/base/l10n/l10n_util.h" |
| 28 #include "ui/events/event.h" | 28 #include "ui/events/event.h" |
| 29 #include "ui/views/background.h" | 29 #include "ui/views/background.h" |
| 30 #include "ui/views/controls/button/label_button.h" | 30 #include "ui/views/controls/button/md_text_button.h" |
| 31 #include "ui/views/controls/label.h" | 31 #include "ui/views/controls/label.h" |
| 32 #include "ui/views/controls/menu/menu_runner.h" | 32 #include "ui/views/controls/menu/menu_runner.h" |
| 33 #include "ui/views/controls/textfield/textfield.h" | 33 #include "ui/views/controls/textfield/textfield.h" |
| 34 #include "ui/views/controls/tree/tree_view.h" | 34 #include "ui/views/controls/tree/tree_view.h" |
| 35 #include "ui/views/focus/focus_manager.h" | 35 #include "ui/views/focus/focus_manager.h" |
| 36 #include "ui/views/layout/grid_layout.h" | 36 #include "ui/views/layout/grid_layout.h" |
| 37 #include "ui/views/layout/layout_constants.h" | 37 #include "ui/views/layout/layout_constants.h" |
| 38 #include "ui/views/widget/widget.h" | 38 #include "ui/views/widget/widget.h" |
| 39 #include "ui/views/window/dialog_client_view.h" | 39 #include "ui/views/window/dialog_client_view.h" |
| 40 #include "url/gurl.h" | 40 #include "url/gurl.h" |
| (...skipping 283 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 324 title_tf_->SetAccessibleName( | 324 title_tf_->SetAccessibleName( |
| 325 l10n_util::GetStringUTF16(IDS_BOOKMARK_AX_EDITOR_NAME_LABEL)); | 325 l10n_util::GetStringUTF16(IDS_BOOKMARK_AX_EDITOR_NAME_LABEL)); |
| 326 title_tf_->SetText(title); | 326 title_tf_->SetText(title); |
| 327 title_tf_->set_controller(this); | 327 title_tf_->set_controller(this); |
| 328 | 328 |
| 329 if (show_tree_) { | 329 if (show_tree_) { |
| 330 tree_view_ = new views::TreeView; | 330 tree_view_ = new views::TreeView; |
| 331 tree_view_->SetRootShown(false); | 331 tree_view_->SetRootShown(false); |
| 332 tree_view_->set_context_menu_controller(this); | 332 tree_view_->set_context_menu_controller(this); |
| 333 | 333 |
| 334 new_folder_button_.reset(new views::LabelButton(this, | 334 new_folder_button_.reset(views::MdTextButton::CreateSecondaryUiButton( |
| 335 this, |
| 335 l10n_util::GetStringUTF16(IDS_BOOKMARK_EDITOR_NEW_FOLDER_BUTTON))); | 336 l10n_util::GetStringUTF16(IDS_BOOKMARK_EDITOR_NEW_FOLDER_BUTTON))); |
| 336 new_folder_button_->SetStyle(views::Button::STYLE_BUTTON); | |
| 337 new_folder_button_->set_owned_by_client(); | 337 new_folder_button_->set_owned_by_client(); |
| 338 new_folder_button_->SetEnabled(false); | 338 new_folder_button_->SetEnabled(false); |
| 339 } | 339 } |
| 340 | 340 |
| 341 GridLayout* layout = GridLayout::CreatePanel(this); | 341 GridLayout* layout = GridLayout::CreatePanel(this); |
| 342 SetLayoutManager(layout); | 342 SetLayoutManager(layout); |
| 343 | 343 |
| 344 const int labels_column_set_id = 0; | 344 const int labels_column_set_id = 0; |
| 345 const int single_column_view_set_id = 1; | 345 const int single_column_view_set_id = 1; |
| 346 const int buttons_column_set_id = 2; | 346 const int buttons_column_set_id = 2; |
| (...skipping 302 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 649 Profile* profile, | 649 Profile* profile, |
| 650 const BookmarkEditor::EditDetails& details, | 650 const BookmarkEditor::EditDetails& details, |
| 651 BookmarkEditor::Configuration configuration) { | 651 BookmarkEditor::Configuration configuration) { |
| 652 DCHECK(profile); | 652 DCHECK(profile); |
| 653 BookmarkEditorView* editor = new BookmarkEditorView( | 653 BookmarkEditorView* editor = new BookmarkEditorView( |
| 654 profile, details.parent_node, details, configuration); | 654 profile, details.parent_node, details, configuration); |
| 655 editor->Show(parent_window); | 655 editor->Show(parent_window); |
| 656 } | 656 } |
| 657 | 657 |
| 658 } // namespace chrome | 658 } // namespace chrome |
| OLD | NEW |