Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(145)

Unified Diff: chrome/browser/ui/views/bookmarks/bookmark_bubble_view.cc

Issue 16279002: bookmarks: Convert "Remove" link into a LabelButton. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/views/bookmarks/bookmark_bubble_view.cc
diff --git a/chrome/browser/ui/views/bookmarks/bookmark_bubble_view.cc b/chrome/browser/ui/views/bookmarks/bookmark_bubble_view.cc
index 20af670256c6f8d26329f0a443c8c89392b3bc33..e6495f00c82c9c5dbbc5383bf17b999fb7ba1a2d 100644
--- a/chrome/browser/ui/views/bookmarks/bookmark_bubble_view.cc
+++ b/chrome/browser/ui/views/bookmarks/bookmark_bubble_view.cc
@@ -146,9 +146,9 @@ bool BookmarkBubbleView::AcceleratorPressed(
}
void BookmarkBubbleView::Init() {
- remove_link_ = new views::Link(l10n_util::GetStringUTF16(
+ remove_button_ = new views::LabelButton(this, l10n_util::GetStringUTF16(
IDS_BOOKMARK_BUBBLE_REMOVE_BOOKMARK));
- remove_link_->set_listener(this);
+ remove_button_->SetStyle(views::Button::STYLE_NATIVE_TEXTBUTTON);
edit_button_ = new views::LabelButton(
this, l10n_util::GetStringUTF16(IDS_BOOKMARK_BUBBLE_OPTIONS));
@@ -195,7 +195,10 @@ void BookmarkBubbleView::Init() {
// Bottom (buttons) row.
msw 2013/05/31 23:13:48 Try a different approach: Remove ColumnSet(2) (use
cs = layout->AddColumnSet(3);
- cs->AddPaddingColumn(1, views::kRelatedControlHorizontalSpacing);
+ cs->AddPaddingColumn(1, views::kUnrelatedControlLargeHorizontalSpacing);
+ cs->AddColumn(GridLayout::LEADING, GridLayout::LEADING, 0,
+ GridLayout::USE_PREF, 0, 0);
+ cs->AddPaddingColumn(1, views::kUnrelatedControlHorizontalSpacing);
cs->AddColumn(GridLayout::LEADING, GridLayout::TRAILING, 0,
GridLayout::USE_PREF, 0, 0);
// We subtract 2 to account for the natural button padding, and
@@ -207,7 +210,6 @@ void BookmarkBubbleView::Init() {
layout->StartRow(0, 0);
layout->AddView(title_label);
- layout->AddView(remove_link_);
layout->AddPaddingRow(0, views::kRelatedControlSmallVerticalSpacing);
layout->StartRow(0, 2);
@@ -226,6 +228,7 @@ void BookmarkBubbleView::Init() {
layout->AddPaddingRow(0, views::kRelatedControlSmallVerticalSpacing);
layout->StartRow(0, 3);
+ layout->AddView(remove_button_);
layout->AddView(edit_button_);
layout->AddView(close_button_);
@@ -246,7 +249,7 @@ BookmarkBubbleView::BookmarkBubbleView(views::View* anchor_view,
BookmarkModelFactory::GetForProfile(profile_),
BookmarkModelFactory::GetForProfile(profile_)->
GetMostRecentlyAddedNodeForURL(url)),
- remove_link_(NULL),
+ remove_button_(NULL),
edit_button_(NULL),
close_button_(NULL),
title_tf_(NULL),
@@ -274,16 +277,6 @@ void BookmarkBubbleView::ButtonPressed(views::Button* sender,
HandleButtonPressed(sender);
}
-void BookmarkBubbleView::LinkClicked(views::Link* source, int event_flags) {
- DCHECK_EQ(remove_link_, source);
- content::RecordAction(UserMetricsAction("BookmarkBubble_Unstar"));
-
- // Set this so we remove the bookmark after the window closes.
- remove_bookmark_ = true;
- apply_edits_ = false;
- StartFade(false);
-}
-
void BookmarkBubbleView::OnSelectedIndexChanged(views::Combobox* combobox) {
if (combobox->selected_index() + 1 == parent_model_.GetItemCount()) {
content::RecordAction(UserMetricsAction("BookmarkBubble_EditFromCombobox"));
@@ -292,7 +285,13 @@ void BookmarkBubbleView::OnSelectedIndexChanged(views::Combobox* combobox) {
}
void BookmarkBubbleView::HandleButtonPressed(views::Button* sender) {
- if (sender == edit_button_) {
+ if (sender == remove_button_) {
+ content::RecordAction(UserMetricsAction("BookmarkBubble_Unstar"));
+ // Set this so we remove the bookmark after the window closes.
+ remove_bookmark_ = true;
+ apply_edits_ = false;
+ StartFade(false);
+ } else if (sender == edit_button_) {
content::RecordAction(UserMetricsAction("BookmarkBubble_Edit"));
ShowEditor();
} else {

Powered by Google App Engine
This is Rietveld 408576698