| 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/memory/ptr_util.h" | 10 #include "base/memory/ptr_util.h" |
| 11 #include "base/strings/string_util.h" | 11 #include "base/strings/string_util.h" |
| 12 #include "base/strings/utf_string_conversions.h" | 12 #include "base/strings/utf_string_conversions.h" |
| 13 #include "chrome/browser/bookmarks/bookmark_model_factory.h" | 13 #include "chrome/browser/bookmarks/bookmark_model_factory.h" |
| 14 #include "chrome/browser/profiles/profile.h" | 14 #include "chrome/browser/profiles/profile.h" |
| 15 #include "chrome/browser/ui/bookmarks/bookmark_utils.h" | 15 #include "chrome/browser/ui/bookmarks/bookmark_utils.h" |
| 16 #include "chrome/browser/ui/bookmarks/bookmark_utils_desktop.h" | 16 #include "chrome/browser/ui/bookmarks/bookmark_utils_desktop.h" |
| 17 #include "chrome/browser/ui/browser_dialogs.h" | 17 #include "chrome/browser/ui/browser_dialogs.h" |
| 18 #include "chrome/browser/ui/views/harmony/layout_delegate.h" | 18 #include "chrome/browser/ui/views/harmony/layout_delegate.h" |
| 19 #include "chrome/browser/ui/views/layout_utils.h" | |
| 20 #include "chrome/grit/generated_resources.h" | 19 #include "chrome/grit/generated_resources.h" |
| 21 #include "chrome/grit/locale_settings.h" | 20 #include "chrome/grit/locale_settings.h" |
| 22 #include "components/bookmarks/browser/bookmark_model.h" | 21 #include "components/bookmarks/browser/bookmark_model.h" |
| 23 #include "components/bookmarks/browser/bookmark_utils.h" | 22 #include "components/bookmarks/browser/bookmark_utils.h" |
| 24 #include "components/constrained_window/constrained_window_views.h" | 23 #include "components/constrained_window/constrained_window_views.h" |
| 25 #include "components/history/core/browser/history_service.h" | 24 #include "components/history/core/browser/history_service.h" |
| 26 #include "components/strings/grit/components_strings.h" | 25 #include "components/strings/grit/components_strings.h" |
| 27 #include "components/url_formatter/url_fixer.h" | 26 #include "components/url_formatter/url_fixer.h" |
| 28 #include "components/user_prefs/user_prefs.h" | 27 #include "components/user_prefs/user_prefs.h" |
| 29 #include "ui/accessibility/ax_node_data.h" | 28 #include "ui/accessibility/ax_node_data.h" |
| (...skipping 304 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 334 tree_view_->SetRootShown(false); | 333 tree_view_->SetRootShown(false); |
| 335 tree_view_->set_context_menu_controller(this); | 334 tree_view_->set_context_menu_controller(this); |
| 336 | 335 |
| 337 new_folder_button_.reset(views::MdTextButton::CreateSecondaryUiButton( | 336 new_folder_button_.reset(views::MdTextButton::CreateSecondaryUiButton( |
| 338 this, | 337 this, |
| 339 l10n_util::GetStringUTF16(IDS_BOOKMARK_EDITOR_NEW_FOLDER_BUTTON))); | 338 l10n_util::GetStringUTF16(IDS_BOOKMARK_EDITOR_NEW_FOLDER_BUTTON))); |
| 340 new_folder_button_->set_owned_by_client(); | 339 new_folder_button_->set_owned_by_client(); |
| 341 new_folder_button_->SetEnabled(false); | 340 new_folder_button_->SetEnabled(false); |
| 342 } | 341 } |
| 343 | 342 |
| 344 GridLayout* layout = layout_utils::CreatePanelLayout(this); | 343 GridLayout* layout = GridLayout::CreatePanel(this); |
| 345 LayoutDelegate* delegate = LayoutDelegate::Get(); | 344 LayoutDelegate* delegate = LayoutDelegate::Get(); |
| 346 | 345 |
| 347 const int labels_column_set_id = 0; | 346 const int labels_column_set_id = 0; |
| 348 const int single_column_view_set_id = 1; | 347 const int single_column_view_set_id = 1; |
| 349 const int buttons_column_set_id = 2; | 348 const int buttons_column_set_id = 2; |
| 350 | 349 |
| 351 views::ColumnSet* column_set = layout->AddColumnSet(labels_column_set_id); | 350 views::ColumnSet* column_set = layout->AddColumnSet(labels_column_set_id); |
| 352 column_set->AddColumn(delegate->GetControlLabelGridAlignment(), | 351 column_set->AddColumn(delegate->GetControlLabelGridAlignment(), |
| 353 GridLayout::CENTER, 0, GridLayout::USE_PREF, 0, 0); | 352 GridLayout::CENTER, 0, GridLayout::USE_PREF, 0, 0); |
| 354 column_set->AddPaddingColumn( | 353 column_set->AddPaddingColumn( |
| (...skipping 321 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 676 Profile* profile, | 675 Profile* profile, |
| 677 const BookmarkEditor::EditDetails& details, | 676 const BookmarkEditor::EditDetails& details, |
| 678 BookmarkEditor::Configuration configuration) { | 677 BookmarkEditor::Configuration configuration) { |
| 679 DCHECK(profile); | 678 DCHECK(profile); |
| 680 BookmarkEditorView* editor = new BookmarkEditorView( | 679 BookmarkEditorView* editor = new BookmarkEditorView( |
| 681 profile, details.parent_node, details, configuration); | 680 profile, details.parent_node, details, configuration); |
| 682 editor->Show(parent_window); | 681 editor->Show(parent_window); |
| 683 } | 682 } |
| 684 | 683 |
| 685 } // namespace chrome | 684 } // namespace chrome |
| OLD | NEW |