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

Unified Diff: chrome/browser/ui/views/download/download_item_view.cc

Issue 2744463002: Add VectorIconButton functionality to ImageButton. (Closed)
Patch Set: fix cros build Created 3 years, 9 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/download/download_item_view.cc
diff --git a/chrome/browser/ui/views/download/download_item_view.cc b/chrome/browser/ui/views/download/download_item_view.cc
index fa2eff196f3d24b0b0a1132d49fcfb07c4d7476d..919cec5662f776286677e4cb0f28bc89ff469749 100644
--- a/chrome/browser/ui/views/download/download_item_view.cc
+++ b/chrome/browser/ui/views/download/download_item_view.cc
@@ -63,7 +63,6 @@
#include "ui/views/animation/ink_drop_impl.h"
#include "ui/views/border.h"
#include "ui/views/controls/button/md_text_button.h"
-#include "ui/views/controls/button/vector_icon_button.h"
#include "ui/views/controls/focusable_border.h"
#include "ui/views/controls/label.h"
#include "ui/views/mouse_constants.h"
@@ -155,16 +154,23 @@ class SeparatorBorder : public views::FocusableBorder {
} // namespace
// Allows the DownloadItemView to control the InkDrop on the drop down button.
-class DownloadItemView::DropDownButton : public views::VectorIconButton {
+class DownloadItemView::DropDownButton : public views::ImageButton {
public:
- explicit DropDownButton(views::VectorIconButtonDelegate* delegate)
- : views::VectorIconButton(delegate) {}
+ explicit DropDownButton(views::ImageButtonDelegate* delegate)
+ : views::ImageButton(delegate) {
+ SetInkDropMode(InkDropHostView::InkDropMode::ON);
+ set_has_ink_drop_action_on_click(true);
+ SetImageAlignment(ImageButton::ALIGN_CENTER, ImageButton::ALIGN_MIDDLE);
+ SetFocusPainter(nullptr);
+ SetPadding(gfx::Insets(kDropdownBorderWidth));
+ }
+
~DropDownButton() override {}
// Promoted visibility to public.
void AnimateInkDrop(views::InkDropState state) {
// TODO(bruthig): Plumb in the proper Event.
- views::VectorIconButton::AnimateInkDrop(state, nullptr /* event */);
+ views::ImageButton::AnimateInkDrop(state, nullptr /* event */);
}
private:
@@ -194,8 +200,6 @@ DownloadItemView::DownloadItemView(DownloadItem* download_item,
download()->AddObserver(this);
set_context_menu_controller(this);
- dropdown_button_->SetBorder(
- views::CreateEmptyBorder(gfx::Insets(kDropdownBorderWidth)));
AddChildView(dropdown_button_);
LoadIcon();
@@ -601,7 +605,7 @@ void DownloadItemView::ButtonPressed(views::Button* sender,
// WARNING: 'this' maybe deleted at this point. Don't access 'this'.
}
-SkColor DownloadItemView::GetVectorIconBaseColor() const {
+SkColor DownloadItemView::GetVectorIconColor() const {
return GetTextColor();
}
@@ -882,8 +886,8 @@ void DownloadItemView::SetDropdownState(State new_state) {
!dropdown_button_->GetImage(views::CustomButton::STATE_NORMAL).isNull())
return;
- dropdown_button_->SetIcon(new_state == PUSHED ? kCaretDownIcon
- : kCaretUpIcon);
+ dropdown_button_->SetVectorIcon(new_state == PUSHED ? kCaretDownIcon
+ : kCaretUpIcon);
if (new_state != dropdown_state_) {
dropdown_button_->AnimateInkDrop(new_state == PUSHED
? views::InkDropState::ACTIVATED

Powered by Google App Engine
This is Rietveld 408576698