OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "base/basictypes.h" | 7 #include "base/basictypes.h" |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 #include "base/string_util.h" | 9 #include "base/string_util.h" |
10 #include "base/utf_string_conversions.h" | 10 #include "base/utf_string_conversions.h" |
(...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
230 ExpandAndSelect(); | 230 ExpandAndSelect(); |
231 window()->Show(); | 231 window()->Show(); |
232 // Select all the text in the name Textfield. | 232 // Select all the text in the name Textfield. |
233 title_tf_.SelectAll(); | 233 title_tf_.SelectAll(); |
234 // Give focus to the name Textfield. | 234 // Give focus to the name Textfield. |
235 title_tf_.RequestFocus(); | 235 title_tf_.RequestFocus(); |
236 } | 236 } |
237 | 237 |
238 void BookmarkEditorView::Close() { | 238 void BookmarkEditorView::Close() { |
239 DCHECK(window()); | 239 DCHECK(window()); |
240 window()->CloseWindow(); | 240 window()->Close(); |
241 } | 241 } |
242 | 242 |
243 void BookmarkEditorView::ShowContextMenuForView(View* source, | 243 void BookmarkEditorView::ShowContextMenuForView(View* source, |
244 const gfx::Point& p, | 244 const gfx::Point& p, |
245 bool is_mouse_gesture) { | 245 bool is_mouse_gesture) { |
246 DCHECK(source == tree_view_); | 246 DCHECK(source == tree_view_); |
247 if (!tree_view_->GetSelectedNode()) | 247 if (!tree_view_->GetSelectedNode()) |
248 return; | 248 return; |
249 running_menu_for_root_ = | 249 running_menu_for_root_ = |
250 (tree_model_->GetParent(tree_view_->GetSelectedNode()) == | 250 (tree_model_->GetParent(tree_view_->GetSelectedNode()) == |
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
384 } | 384 } |
385 | 385 |
386 void BookmarkEditorView::BookmarkNodeRemoved(BookmarkModel* model, | 386 void BookmarkEditorView::BookmarkNodeRemoved(BookmarkModel* model, |
387 const BookmarkNode* parent, | 387 const BookmarkNode* parent, |
388 int index, | 388 int index, |
389 const BookmarkNode* node) { | 389 const BookmarkNode* node) { |
390 if ((details_.type == EditDetails::EXISTING_NODE && | 390 if ((details_.type == EditDetails::EXISTING_NODE && |
391 details_.existing_node->HasAncestor(node)) || | 391 details_.existing_node->HasAncestor(node)) || |
392 (parent_ && parent_->HasAncestor(node))) { | 392 (parent_ && parent_->HasAncestor(node))) { |
393 // The node, or its parent was removed. Close the dialog. | 393 // The node, or its parent was removed. Close the dialog. |
394 window()->CloseWindow(); | 394 window()->Close(); |
395 } else { | 395 } else { |
396 Reset(); | 396 Reset(); |
397 } | 397 } |
398 } | 398 } |
399 | 399 |
400 void BookmarkEditorView::BookmarkNodeChildrenReordered( | 400 void BookmarkEditorView::BookmarkNodeChildrenReordered( |
401 BookmarkModel* model, const BookmarkNode* node) { | 401 BookmarkModel* model, const BookmarkNode* node) { |
402 Reset(); | 402 Reset(); |
403 } | 403 } |
404 | 404 |
(...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
580 break; | 580 break; |
581 } | 581 } |
582 } | 582 } |
583 DCHECK(child_bb_node); | 583 DCHECK(child_bb_node); |
584 bb_model_->SetTitle(child_bb_node, child_b_node->GetTitle()); | 584 bb_model_->SetTitle(child_bb_node, child_b_node->GetTitle()); |
585 } | 585 } |
586 ApplyNameChangesAndCreateNewFolders(child_bb_node, child_b_node, | 586 ApplyNameChangesAndCreateNewFolders(child_bb_node, child_b_node, |
587 parent_b_node, parent_bb_node); | 587 parent_b_node, parent_bb_node); |
588 } | 588 } |
589 } | 589 } |
OLD | NEW |