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 211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
222 UserInputChanged(); | 222 UserInputChanged(); |
223 if (show_tree_ && bb_model_->loaded()) | 223 if (show_tree_ && bb_model_->loaded()) |
224 ExpandAndSelect(); | 224 ExpandAndSelect(); |
225 GetWidget()->Show(); | 225 GetWidget()->Show(); |
226 // Select all the text in the name Textfield. | 226 // Select all the text in the name Textfield. |
227 title_tf_->SelectAll(true); | 227 title_tf_->SelectAll(true); |
228 // Give focus to the name Textfield. | 228 // Give focus to the name Textfield. |
229 title_tf_->RequestFocus(); | 229 title_tf_->RequestFocus(); |
230 } | 230 } |
231 | 231 |
232 void BookmarkEditorView::Close() { | |
233 DCHECK(GetWidget()); | |
234 GetWidget()->Close(); | |
235 } | |
236 | |
237 void BookmarkEditorView::ShowContextMenuForView( | 232 void BookmarkEditorView::ShowContextMenuForView( |
238 views::View* source, | 233 views::View* source, |
239 const gfx::Point& point, | 234 const gfx::Point& point, |
240 ui::MenuSourceType source_type) { | 235 ui::MenuSourceType source_type) { |
241 DCHECK_EQ(tree_view_, source); | 236 DCHECK_EQ(tree_view_, source); |
242 if (!tree_view_->GetSelectedNode()) | 237 if (!tree_view_->GetSelectedNode()) |
243 return; | 238 return; |
244 running_menu_for_root_ = | 239 running_menu_for_root_ = |
245 (tree_model_->GetParent(tree_view_->GetSelectedNode()) == | 240 (tree_model_->GetParent(tree_view_->GetSelectedNode()) == |
246 tree_model_->GetRoot()); | 241 tree_model_->GetRoot()); |
(...skipping 377 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
624 IDS_BOOKMARK_EDITOR_NEW_FOLDER_MENU_ITEM); | 619 IDS_BOOKMARK_EDITOR_NEW_FOLDER_MENU_ITEM); |
625 } | 620 } |
626 return context_menu_model_.get(); | 621 return context_menu_model_.get(); |
627 } | 622 } |
628 | 623 |
629 void BookmarkEditorView::EditorTreeModel::SetTitle(ui::TreeModelNode* node, | 624 void BookmarkEditorView::EditorTreeModel::SetTitle(ui::TreeModelNode* node, |
630 const string16& title) { | 625 const string16& title) { |
631 if (!title.empty()) | 626 if (!title.empty()) |
632 ui::TreeNodeModel<EditorNode>::SetTitle(node, title); | 627 ui::TreeNodeModel<EditorNode>::SetTitle(node, title); |
633 } | 628 } |
OLD | NEW |