Chromium Code Reviews| 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 { |