| 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 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 127 url_tf_->SelectAll(true); | 127 url_tf_->SelectAll(true); |
| 128 url_tf_->RequestFocus(); | 128 url_tf_->RequestFocus(); |
| 129 } | 129 } |
| 130 return false; | 130 return false; |
| 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 gfx::Size BookmarkEditorView::GetPreferredSize() { | 137 gfx::Size BookmarkEditorView::GetPreferredSize() const { |
| 138 if (!show_tree_) | 138 if (!show_tree_) |
| 139 return views::View::GetPreferredSize(); | 139 return views::View::GetPreferredSize(); |
| 140 | 140 |
| 141 return gfx::Size(views::Widget::GetLocalizedContentsSize( | 141 return gfx::Size(views::Widget::GetLocalizedContentsSize( |
| 142 IDS_EDITBOOKMARK_DIALOG_WIDTH_CHARS, | 142 IDS_EDITBOOKMARK_DIALOG_WIDTH_CHARS, |
| 143 IDS_EDITBOOKMARK_DIALOG_HEIGHT_LINES)); | 143 IDS_EDITBOOKMARK_DIALOG_HEIGHT_LINES)); |
| 144 } | 144 } |
| 145 | 145 |
| 146 void BookmarkEditorView::OnTreeViewSelectionChanged( | 146 void BookmarkEditorView::OnTreeViewSelectionChanged( |
| 147 views::TreeView* tree_view) { | 147 views::TreeView* tree_view) { |
| (...skipping 487 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 635 } | 635 } |
| 636 return context_menu_model_.get(); | 636 return context_menu_model_.get(); |
| 637 } | 637 } |
| 638 | 638 |
| 639 void BookmarkEditorView::EditorTreeModel::SetTitle( | 639 void BookmarkEditorView::EditorTreeModel::SetTitle( |
| 640 ui::TreeModelNode* node, | 640 ui::TreeModelNode* node, |
| 641 const base::string16& title) { | 641 const base::string16& title) { |
| 642 if (!title.empty()) | 642 if (!title.empty()) |
| 643 ui::TreeNodeModel<EditorNode>::SetTitle(node, title); | 643 ui::TreeNodeModel<EditorNode>::SetTitle(node, title); |
| 644 } | 644 } |
| OLD | NEW |