| 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 url_tf_->SelectAll(true); | 131 url_tf_->SelectAll(true); |
| 132 url_tf_->RequestFocus(); | 132 url_tf_->RequestFocus(); |
| 133 } | 133 } |
| 134 return false; | 134 return false; |
| 135 } | 135 } |
| 136 // Otherwise save changes and close the dialog box. | 136 // Otherwise save changes and close the dialog box. |
| 137 ApplyEdits(); | 137 ApplyEdits(); |
| 138 return true; | 138 return true; |
| 139 } | 139 } |
| 140 | 140 |
| 141 const char* BookmarkEditorView::GetClassName() const { |
| 142 return "BookmarkEditorView"; |
| 143 } |
| 144 |
| 141 gfx::Size BookmarkEditorView::GetPreferredSize() const { | 145 gfx::Size BookmarkEditorView::GetPreferredSize() const { |
| 142 if (!show_tree_) | 146 if (!show_tree_) |
| 143 return views::View::GetPreferredSize(); | 147 return views::View::GetPreferredSize(); |
| 144 | 148 |
| 145 return gfx::Size(views::Widget::GetLocalizedContentsSize( | 149 return gfx::Size(views::Widget::GetLocalizedContentsSize( |
| 146 IDS_EDITBOOKMARK_DIALOG_WIDTH_CHARS, | 150 IDS_EDITBOOKMARK_DIALOG_WIDTH_CHARS, |
| 147 IDS_EDITBOOKMARK_DIALOG_HEIGHT_LINES)); | 151 IDS_EDITBOOKMARK_DIALOG_HEIGHT_LINES)); |
| 148 } | 152 } |
| 149 | 153 |
| 150 void BookmarkEditorView::OnTreeViewSelectionChanged( | 154 void BookmarkEditorView::OnTreeViewSelectionChanged( |
| (...skipping 490 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 641 } | 645 } |
| 642 return context_menu_model_.get(); | 646 return context_menu_model_.get(); |
| 643 } | 647 } |
| 644 | 648 |
| 645 void BookmarkEditorView::EditorTreeModel::SetTitle( | 649 void BookmarkEditorView::EditorTreeModel::SetTitle( |
| 646 ui::TreeModelNode* node, | 650 ui::TreeModelNode* node, |
| 647 const base::string16& title) { | 651 const base::string16& title) { |
| 648 if (!title.empty()) | 652 if (!title.empty()) |
| 649 ui::TreeNodeModel<EditorNode>::SetTitle(node, title); | 653 ui::TreeNodeModel<EditorNode>::SetTitle(node, title); |
| 650 } | 654 } |
| OLD | NEW |