| 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/basictypes.h" | 9 #include "base/basictypes.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 131 } | 131 } |
| 132 // Otherwise save changes and close the dialog box. | 132 // Otherwise save changes and close the dialog box. |
| 133 ApplyEdits(); | 133 ApplyEdits(); |
| 134 return true; | 134 return true; |
| 135 } | 135 } |
| 136 | 136 |
| 137 bool BookmarkEditorView::AreAcceleratorsEnabled(ui::DialogButton button) { | 137 bool BookmarkEditorView::AreAcceleratorsEnabled(ui::DialogButton button) { |
| 138 return !show_tree_ || !tree_view_->GetEditingNode(); | 138 return !show_tree_ || !tree_view_->GetEditingNode(); |
| 139 } | 139 } |
| 140 | 140 |
| 141 views::View* BookmarkEditorView::GetContentsView() { | |
| 142 return this; | |
| 143 } | |
| 144 | |
| 145 void BookmarkEditorView::Layout() { | 141 void BookmarkEditorView::Layout() { |
| 146 // Let the grid layout manager lay out most of the dialog... | 142 // Let the grid layout manager lay out most of the dialog... |
| 147 GetLayoutManager()->Layout(this); | 143 GetLayoutManager()->Layout(this); |
| 148 | 144 |
| 149 if (!show_tree_) | 145 if (!show_tree_) |
| 150 return; | 146 return; |
| 151 | 147 |
| 152 // Manually lay out the New Folder button in the same row as the OK/Cancel | 148 // Manually lay out the New Folder button in the same row as the OK/Cancel |
| 153 // buttons... | 149 // buttons... |
| 154 gfx::Rect parent_bounds = parent()->GetContentsBounds(); | 150 gfx::Rect parent_bounds = parent()->GetContentsBounds(); |
| (...skipping 504 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 659 IDS_BOOKMARK_EDITOR_NEW_FOLDER_MENU_ITEM); | 655 IDS_BOOKMARK_EDITOR_NEW_FOLDER_MENU_ITEM); |
| 660 } | 656 } |
| 661 return context_menu_model_.get(); | 657 return context_menu_model_.get(); |
| 662 } | 658 } |
| 663 | 659 |
| 664 void BookmarkEditorView::EditorTreeModel::SetTitle(ui::TreeModelNode* node, | 660 void BookmarkEditorView::EditorTreeModel::SetTitle(ui::TreeModelNode* node, |
| 665 const string16& title) { | 661 const string16& title) { |
| 666 if (!title.empty()) | 662 if (!title.empty()) |
| 667 ui::TreeNodeModel<EditorNode>::SetTitle(node, title); | 663 ui::TreeNodeModel<EditorNode>::SetTitle(node, title); |
| 668 } | 664 } |
| OLD | NEW |