Chromium Code Reviews| 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" |
| (...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 125 url_tf_->SelectAll(true); | 125 url_tf_->SelectAll(true); |
| 126 url_tf_->RequestFocus(); | 126 url_tf_->RequestFocus(); |
| 127 } | 127 } |
| 128 return false; | 128 return false; |
| 129 } | 129 } |
| 130 // Otherwise save changes and close the dialog box. | 130 // Otherwise save changes and close the dialog box. |
| 131 ApplyEdits(); | 131 ApplyEdits(); |
| 132 return true; | 132 return true; |
| 133 } | 133 } |
| 134 | 134 |
| 135 gfx::Size BookmarkEditorView::GetPreferredSize() const { | 135 gfx::Size BookmarkEditorView::GetUnsnappedPreferredSize() const { |
| 136 if (!show_tree_) | 136 if (!show_tree_) |
| 137 return views::View::GetPreferredSize(); | 137 return views::View::GetPreferredSize(); |
| 138 | 138 |
| 139 return gfx::Size(views::Widget::GetLocalizedContentsSize( | 139 return gfx::Size(views::Widget::GetLocalizedContentsSize( |
| 140 IDS_EDITBOOKMARK_DIALOG_WIDTH_CHARS, | 140 IDS_EDITBOOKMARK_DIALOG_WIDTH_CHARS, |
| 141 IDS_EDITBOOKMARK_DIALOG_HEIGHT_LINES)); | 141 IDS_EDITBOOKMARK_DIALOG_HEIGHT_LINES)); |
|
Peter Kasting
2017/03/30 00:35:34
Hmm. This isn't the right way to size this dialog
| |
| 142 } | 142 } |
| 143 | 143 |
| 144 void BookmarkEditorView::OnTreeViewSelectionChanged( | 144 void BookmarkEditorView::OnTreeViewSelectionChanged( |
| 145 views::TreeView* tree_view) { | 145 views::TreeView* tree_view) { |
| 146 } | 146 } |
| 147 | 147 |
| 148 bool BookmarkEditorView::CanEdit(views::TreeView* tree_view, | 148 bool BookmarkEditorView::CanEdit(views::TreeView* tree_view, |
| 149 ui::TreeModelNode* node) { | 149 ui::TreeModelNode* node) { |
| 150 // Only allow editting of children of the bookmark bar node and other node. | 150 // Only allow editting of children of the bookmark bar node and other node. |
| 151 EditorNode* bb_node = tree_model_->AsNode(node); | 151 EditorNode* bb_node = tree_model_->AsNode(node); |
| (...skipping 524 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 676 Profile* profile, | 676 Profile* profile, |
| 677 const BookmarkEditor::EditDetails& details, | 677 const BookmarkEditor::EditDetails& details, |
| 678 BookmarkEditor::Configuration configuration) { | 678 BookmarkEditor::Configuration configuration) { |
| 679 DCHECK(profile); | 679 DCHECK(profile); |
| 680 BookmarkEditorView* editor = new BookmarkEditorView( | 680 BookmarkEditorView* editor = new BookmarkEditorView( |
| 681 profile, details.parent_node, details, configuration); | 681 profile, details.parent_node, details, configuration); |
| 682 editor->Show(parent_window); | 682 editor->Show(parent_window); |
| 683 } | 683 } |
| 684 | 684 |
| 685 } // namespace chrome | 685 } // namespace chrome |
| OLD | NEW |