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

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: getting there 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
« no previous file with comments | « chrome/browser/ui/views/bookmarks/bookmark_bubble_view.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..d30e59eaeabf599b412d65a93fda98fb9ff37838 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));
@@ -185,47 +185,49 @@ void BookmarkBubbleView::Init() {
cs->AddColumn(GridLayout::CENTER, GridLayout::CENTER, 0, GridLayout::USE_PREF,
0, 0);
- // Middle (input field) rows.
cs = layout->AddColumnSet(2);
cs->AddColumn(GridLayout::LEADING, GridLayout::CENTER, 0,
GridLayout::USE_PREF, 0, 0);
cs->AddPaddingColumn(0, views::kRelatedControlHorizontalSpacing);
msw 2013/06/01 01:07:28 This value (8) needs to be increased to match 15 i
tfarina 2013/06/01 03:33:42 Done.
- cs->AddColumn(GridLayout::FILL, GridLayout::CENTER, 1,
+
+ cs->AddColumn(GridLayout::FILL, GridLayout::CENTER, 0,
GridLayout::USE_PREF, 0, kMinimumFieldSize);
msw 2013/06/01 01:18:48 Remove kMinimumFieldSize here.
tfarina 2013/06/01 03:33:42 Done.
+ cs->AddPaddingColumn(1, views::kUnrelatedControlLargeHorizontalSpacing);
- // Bottom (buttons) row.
- cs = layout->AddColumnSet(3);
- cs->AddPaddingColumn(1, views::kRelatedControlHorizontalSpacing);
cs->AddColumn(GridLayout::LEADING, GridLayout::TRAILING, 0,
GridLayout::USE_PREF, 0, 0);
// We subtract 2 to account for the natural button padding, and
// to bring the separation visually in line with the row separation
// height.
cs->AddPaddingColumn(0, views::kRelatedButtonHSpacing - 2);
+
cs->AddColumn(GridLayout::LEADING, GridLayout::TRAILING, 0,
GridLayout::USE_PREF, 0, 0);
layout->StartRow(0, 0);
layout->AddView(title_label);
- layout->AddView(remove_link_);
layout->AddPaddingRow(0, views::kRelatedControlSmallVerticalSpacing);
+
layout->StartRow(0, 2);
views::Label* label = new views::Label(
l10n_util::GetStringUTF16(IDS_BOOKMARK_BUBBLE_TITLE_TEXT));
layout->AddView(label);
title_tf_ = new views::Textfield();
title_tf_->SetText(GetTitle());
- layout->AddView(title_tf_);
+ layout->AddView(title_tf_, 5, 1);
layout->AddPaddingRow(0, views::kRelatedControlSmallVerticalSpacing);
msw 2013/06/01 01:07:28 This value (4) needs to be increased to match 10 i
tfarina 2013/06/01 03:33:42 Done.
layout->StartRow(0, 2);
layout->AddView(combobox_label);
- layout->AddView(parent_combobox_);
+ layout->AddView(parent_combobox_, 5, 1);
+
layout->AddPaddingRow(0, views::kRelatedControlSmallVerticalSpacing);
msw 2013/06/01 01:07:28 ditto, use kRelatedControlVerticalSpacing.
tfarina 2013/06/01 03:33:42 Done.
- layout->StartRow(0, 3);
+ layout->StartRow(0, 2);
+ layout->SkipColumns(2);
+ layout->AddView(remove_button_);
layout->AddView(edit_button_);
layout->AddView(close_button_);
@@ -246,7 +248,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 +276,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 +284,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 {
« no previous file with comments | « chrome/browser/ui/views/bookmarks/bookmark_bubble_view.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698