| 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/strings/string16.h" | 7 #include "base/strings/string16.h" |
| 8 #include "base/strings/string_util.h" | 8 #include "base/strings/string_util.h" |
| 9 #include "base/strings/utf_string_conversions.h" | 9 #include "base/strings/utf_string_conversions.h" |
| 10 #include "chrome/app/chrome_command_ids.h" | 10 #include "chrome/app/chrome_command_ids.h" |
| (...skipping 289 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 300 l10n_util::GetStringUTF16( | 300 l10n_util::GetStringUTF16( |
| 301 newly_bookmarked_ ? IDS_BOOKMARK_BUBBLE_PAGE_BOOKMARKED : | 301 newly_bookmarked_ ? IDS_BOOKMARK_BUBBLE_PAGE_BOOKMARKED : |
| 302 IDS_BOOKMARK_AX_BUBBLE_PAGE_BOOKMARK); | 302 IDS_BOOKMARK_AX_BUBBLE_PAGE_BOOKMARK); |
| 303 } | 303 } |
| 304 | 304 |
| 305 void BookmarkBubbleView::ButtonPressed(views::Button* sender, | 305 void BookmarkBubbleView::ButtonPressed(views::Button* sender, |
| 306 const ui::Event& event) { | 306 const ui::Event& event) { |
| 307 HandleButtonPressed(sender); | 307 HandleButtonPressed(sender); |
| 308 } | 308 } |
| 309 | 309 |
| 310 void BookmarkBubbleView::OnSelectedIndexChanged(views::Combobox* combobox) { | 310 void BookmarkBubbleView::OnPerformAction(views::Combobox* combobox) { |
| 311 if (combobox->selected_index() + 1 == parent_model_.GetItemCount()) { | 311 if (combobox->selected_index() + 1 == parent_model_.GetItemCount()) { |
| 312 content::RecordAction(UserMetricsAction("BookmarkBubble_EditFromCombobox")); | 312 content::RecordAction(UserMetricsAction("BookmarkBubble_EditFromCombobox")); |
| 313 ShowEditor(); | 313 ShowEditor(); |
| 314 } | 314 } |
| 315 } | 315 } |
| 316 | 316 |
| 317 void BookmarkBubbleView::HandleButtonPressed(views::Button* sender) { | 317 void BookmarkBubbleView::HandleButtonPressed(views::Button* sender) { |
| 318 if (sender == remove_button_) { | 318 if (sender == remove_button_) { |
| 319 content::RecordAction(UserMetricsAction("BookmarkBubble_Unstar")); | 319 content::RecordAction(UserMetricsAction("BookmarkBubble_Unstar")); |
| 320 // Set this so we remove the bookmark after the window closes. | 320 // Set this so we remove the bookmark after the window closes. |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 355 if (node) { | 355 if (node) { |
| 356 const base::string16 new_title = title_tf_->text(); | 356 const base::string16 new_title = title_tf_->text(); |
| 357 if (new_title != node->GetTitle()) { | 357 if (new_title != node->GetTitle()) { |
| 358 model->SetTitle(node, new_title); | 358 model->SetTitle(node, new_title); |
| 359 content::RecordAction( | 359 content::RecordAction( |
| 360 UserMetricsAction("BookmarkBubble_ChangeTitleInBubble")); | 360 UserMetricsAction("BookmarkBubble_ChangeTitleInBubble")); |
| 361 } | 361 } |
| 362 parent_model_.MaybeChangeParent(node, parent_combobox_->selected_index()); | 362 parent_model_.MaybeChangeParent(node, parent_combobox_->selected_index()); |
| 363 } | 363 } |
| 364 } | 364 } |
| OLD | NEW |