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_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 280 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
291 content::RecordAction(UserMetricsAction("BookmarkBubble_EditFromCombobox")); | 291 content::RecordAction(UserMetricsAction("BookmarkBubble_EditFromCombobox")); |
292 ShowEditor(); | 292 ShowEditor(); |
293 } | 293 } |
294 } | 294 } |
295 | 295 |
296 void BookmarkBubbleView::HandleButtonPressed(views::Button* sender) { | 296 void BookmarkBubbleView::HandleButtonPressed(views::Button* sender) { |
297 if (sender == edit_button_) { | 297 if (sender == edit_button_) { |
298 content::RecordAction(UserMetricsAction("BookmarkBubble_Edit")); | 298 content::RecordAction(UserMetricsAction("BookmarkBubble_Edit")); |
299 ShowEditor(); | 299 ShowEditor(); |
300 } else { | 300 } else { |
301 DCHECK_EQ(sender, close_button_); | 301 DCHECK_EQ(close_button_, sender); |
302 StartFade(false); | 302 StartFade(false); |
303 } | 303 } |
304 } | 304 } |
305 | 305 |
306 void BookmarkBubbleView::ShowEditor() { | 306 void BookmarkBubbleView::ShowEditor() { |
307 const BookmarkNode* node = | 307 const BookmarkNode* node = |
308 profile_->GetBookmarkModel()->GetMostRecentlyAddedNodeForURL(url_); | 308 profile_->GetBookmarkModel()->GetMostRecentlyAddedNodeForURL(url_); |
309 views::Widget* parent = anchor_view()->GetWidget(); | 309 views::Widget* parent = anchor_view()->GetWidget(); |
310 Profile* profile = profile_; | 310 Profile* profile = profile_; |
311 ApplyEdits(); | 311 ApplyEdits(); |
(...skipping 23 matching lines...) Expand all Loading... |
335 const BookmarkNode* new_parent = | 335 const BookmarkNode* new_parent = |
336 parent_model_.GetNodeAt(parent_combobox_->selected_index()); | 336 parent_model_.GetNodeAt(parent_combobox_->selected_index()); |
337 if (new_parent != node->parent()) { | 337 if (new_parent != node->parent()) { |
338 content::RecordAction( | 338 content::RecordAction( |
339 UserMetricsAction("BookmarkBubble_ChangeParent")); | 339 UserMetricsAction("BookmarkBubble_ChangeParent")); |
340 model->Move(node, new_parent, new_parent->child_count()); | 340 model->Move(node, new_parent, new_parent->child_count()); |
341 } | 341 } |
342 } | 342 } |
343 } | 343 } |
344 } | 344 } |
OLD | NEW |