| 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/grit/generated_resources.h" | 18 #include "chrome/grit/generated_resources.h" |
| 19 #include "chrome/grit/locale_settings.h" | 19 #include "chrome/grit/locale_settings.h" |
| 20 #include "components/bookmarks/browser/bookmark_model.h" | 20 #include "components/bookmarks/browser/bookmark_model.h" |
| 21 #include "components/bookmarks/browser/bookmark_utils.h" | 21 #include "components/bookmarks/browser/bookmark_utils.h" |
| 22 #include "components/constrained_window/constrained_window_views.h" | 22 #include "components/constrained_window/constrained_window_views.h" |
| 23 #include "components/history/core/browser/history_service.h" | 23 #include "components/history/core/browser/history_service.h" |
| 24 #include "components/strings/grit/components_strings.h" | 24 #include "components/strings/grit/components_strings.h" |
| 25 #include "components/url_formatter/url_fixer.h" | 25 #include "components/url_formatter/url_fixer.h" |
| 26 #include "components/user_prefs/user_prefs.h" | 26 #include "components/user_prefs/user_prefs.h" |
| 27 #include "ui/accessibility/ax_view_state.h" | 27 #include "ui/accessibility/ax_node_data.h" |
| 28 #include "ui/base/l10n/l10n_util.h" | 28 #include "ui/base/l10n/l10n_util.h" |
| 29 #include "ui/base/material_design/material_design_controller.h" | 29 #include "ui/base/material_design/material_design_controller.h" |
| 30 #include "ui/events/event.h" | 30 #include "ui/events/event.h" |
| 31 #include "ui/views/background.h" | 31 #include "ui/views/background.h" |
| 32 #include "ui/views/controls/button/md_text_button.h" | 32 #include "ui/views/controls/button/md_text_button.h" |
| 33 #include "ui/views/controls/label.h" | 33 #include "ui/views/controls/label.h" |
| 34 #include "ui/views/controls/menu/menu_runner.h" | 34 #include "ui/views/controls/menu/menu_runner.h" |
| 35 #include "ui/views/controls/textfield/textfield.h" | 35 #include "ui/views/controls/textfield/textfield.h" |
| 36 #include "ui/views/controls/tree/tree_view.h" | 36 #include "ui/views/controls/tree/tree_view.h" |
| 37 #include "ui/views/focus/focus_manager.h" | 37 #include "ui/views/focus/focus_manager.h" |
| (...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 154 void BookmarkEditorView::ContentsChanged(views::Textfield* sender, | 154 void BookmarkEditorView::ContentsChanged(views::Textfield* sender, |
| 155 const base::string16& new_contents) { | 155 const base::string16& new_contents) { |
| 156 UserInputChanged(); | 156 UserInputChanged(); |
| 157 } | 157 } |
| 158 | 158 |
| 159 bool BookmarkEditorView::HandleKeyEvent(views::Textfield* sender, | 159 bool BookmarkEditorView::HandleKeyEvent(views::Textfield* sender, |
| 160 const ui::KeyEvent& key_event) { | 160 const ui::KeyEvent& key_event) { |
| 161 return false; | 161 return false; |
| 162 } | 162 } |
| 163 | 163 |
| 164 void BookmarkEditorView::GetAccessibleState(ui::AXViewState* state) { | 164 void BookmarkEditorView::GetAccessibleNodeData(ui::AXNodeData* node_data) { |
| 165 views::DialogDelegateView::GetAccessibleState(state); | 165 views::DialogDelegateView::GetAccessibleNodeData(node_data); |
| 166 state->name = | 166 node_data->SetName(l10n_util::GetStringUTF8(IDS_BOOKMARK_EDITOR_TITLE)); |
| 167 l10n_util::GetStringUTF16(IDS_BOOKMARK_EDITOR_TITLE); | |
| 168 } | 167 } |
| 169 | 168 |
| 170 void BookmarkEditorView::ButtonPressed(views::Button* sender, | 169 void BookmarkEditorView::ButtonPressed(views::Button* sender, |
| 171 const ui::Event& event) { | 170 const ui::Event& event) { |
| 172 DCHECK_EQ(new_folder_button_.get(), sender); | 171 DCHECK_EQ(new_folder_button_.get(), sender); |
| 173 NewFolder(); | 172 NewFolder(); |
| 174 } | 173 } |
| 175 | 174 |
| 176 bool BookmarkEditorView::IsCommandIdChecked(int command_id) const { | 175 bool BookmarkEditorView::IsCommandIdChecked(int command_id) const { |
| 177 return false; | 176 return false; |
| (...skipping 478 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 656 Profile* profile, | 655 Profile* profile, |
| 657 const BookmarkEditor::EditDetails& details, | 656 const BookmarkEditor::EditDetails& details, |
| 658 BookmarkEditor::Configuration configuration) { | 657 BookmarkEditor::Configuration configuration) { |
| 659 DCHECK(profile); | 658 DCHECK(profile); |
| 660 BookmarkEditorView* editor = new BookmarkEditorView( | 659 BookmarkEditorView* editor = new BookmarkEditorView( |
| 661 profile, details.parent_node, details, configuration); | 660 profile, details.parent_node, details, configuration); |
| 662 editor->Show(parent_window); | 661 editor->Show(parent_window); |
| 663 } | 662 } |
| 664 | 663 |
| 665 } // namespace chrome | 664 } // namespace chrome |
| OLD | NEW |