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_bubble_view.h" | 5 #include "chrome/browser/ui/views/bookmarks/bookmark_bubble_view.h" |
6 | 6 |
7 #include "base/string16.h" | 7 #include "base/string16.h" |
8 #include "base/string_util.h" | 8 #include "base/string_util.h" |
9 #include "base/utf_string_conversions.h" | 9 #include "base/utf_string_conversions.h" |
10 #include "chrome/app/chrome_command_ids.h" | 10 #include "chrome/app/chrome_command_ids.h" |
(...skipping 284 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
295 ShowEditor(); | 295 ShowEditor(); |
296 } else { | 296 } else { |
297 DCHECK_EQ(sender, close_button_); | 297 DCHECK_EQ(sender, close_button_); |
298 StartFade(false); | 298 StartFade(false); |
299 } | 299 } |
300 } | 300 } |
301 | 301 |
302 void BookmarkBubbleView::ShowEditor() { | 302 void BookmarkBubbleView::ShowEditor() { |
303 const BookmarkNode* node = | 303 const BookmarkNode* node = |
304 profile_->GetBookmarkModel()->GetMostRecentlyAddedNodeForURL(url_); | 304 profile_->GetBookmarkModel()->GetMostRecentlyAddedNodeForURL(url_); |
305 views::Widget* parent = anchor_view()->GetWidget(); | 305 const views::Widget* parent = anchor_view()->GetWidget(); |
306 Profile* profile = profile_; | 306 Profile* profile = profile_; |
307 ApplyEdits(); | 307 ApplyEdits(); |
308 GetWidget()->Close(); | 308 GetWidget()->Close(); |
309 | 309 |
310 if (node) | 310 if (node) |
311 BookmarkEditor::Show(parent->GetNativeWindow(), profile, | 311 BookmarkEditor::Show(parent->GetNativeWindow(), profile, |
312 BookmarkEditor::EditDetails::EditNode(node), | 312 BookmarkEditor::EditDetails::EditNode(node), |
313 BookmarkEditor::SHOW_TREE); | 313 BookmarkEditor::SHOW_TREE); |
314 } | 314 } |
315 | 315 |
(...skipping 15 matching lines...) Expand all Loading... |
331 const BookmarkNode* new_parent = | 331 const BookmarkNode* new_parent = |
332 parent_model_.GetNodeAt(parent_combobox_->selected_item()); | 332 parent_model_.GetNodeAt(parent_combobox_->selected_item()); |
333 if (new_parent != node->parent()) { | 333 if (new_parent != node->parent()) { |
334 UserMetrics::RecordAction( | 334 UserMetrics::RecordAction( |
335 UserMetricsAction("BookmarkBubble_ChangeParent")); | 335 UserMetricsAction("BookmarkBubble_ChangeParent")); |
336 model->Move(node, new_parent, new_parent->child_count()); | 336 model->Move(node, new_parent, new_parent->child_count()); |
337 } | 337 } |
338 } | 338 } |
339 } | 339 } |
340 } | 340 } |
OLD | NEW |