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

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

Issue 2305933002: Update dialog close buttons to use vector icons and ripples. (Closed)
Patch Set: delegate Created 4 years, 3 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_md.cc
diff --git a/chrome/browser/ui/views/download/download_item_view_md.cc b/chrome/browser/ui/views/download/download_item_view_md.cc
index 9ed34ac9c4f6f9090f972b0d1931b341047a2e1b..5cffb07a194a272f8919f52d0c02865f02bfcc6e 100644
--- a/chrome/browser/ui/views/download/download_item_view_md.cc
+++ b/chrome/browser/ui/views/download/download_item_view_md.cc
@@ -35,7 +35,6 @@
#include "chrome/browser/safe_browsing/download_protection_service.h"
#include "chrome/browser/safe_browsing/safe_browsing_service.h"
#include "chrome/browser/themes/theme_properties.h"
-#include "chrome/browser/ui/views/bar_control_button.h"
#include "chrome/browser/ui/views/download/download_feedback_dialog_view.h"
#include "chrome/browser/ui/views/download/download_shelf_context_menu_view.h"
#include "chrome/browser/ui/views/download/download_shelf_view.h"
@@ -65,6 +64,7 @@
#include "ui/views/border.h"
#include "ui/views/controls/button/image_button.h"
#include "ui/views/controls/button/md_text_button.h"
+#include "ui/views/controls/button/vector_icon_button.h"
#include "ui/views/controls/label.h"
#include "ui/views/mouse_constants.h"
#include "ui/views/widget/root_view.h"
@@ -153,16 +153,16 @@ class SeparatorBorder : public views::Border {
} // namespace
// Allows the DownloadItemViewMd to control the InkDrop on the drop down button.
-class DownloadItemViewMd::DropDownButton : public BarControlButton {
+class DownloadItemViewMd::DropDownButton : public views::VectorIconButton {
public:
- explicit DropDownButton(views::ButtonListener* listener)
- : BarControlButton(listener) {}
+ explicit DropDownButton(views::VectorIconButtonDelegate* delegate)
+ : views::VectorIconButton(delegate) {}
~DropDownButton() override {}
// Promoted visibility to public.
void AnimateInkDrop(views::InkDropState state) {
// TODO(bruthig): Plumb in the proper Event.
- BarControlButton::AnimateInkDrop(state, nullptr /* event */);
+ views::VectorIconButton::AnimateInkDrop(state, nullptr /* event */);
}
private:
@@ -594,6 +594,10 @@ void DownloadItemViewMd::ButtonPressed(views::Button* sender,
download()->Remove();
}
+SkColor DownloadItemViewMd::GetVectorIconBaseColor() const {
+ return GetTextColor();
+}
+
void DownloadItemViewMd::AnimationProgressed(const gfx::Animation* animation) {
// We don't care if what animation (body button/drop button/complete),
// is calling back, as they all have to go through the same paint call.
@@ -870,10 +874,8 @@ void DownloadItemViewMd::SetDropdownState(State new_state) {
!dropdown_button_->GetImage(views::CustomButton::STATE_NORMAL).isNull())
return;
- dropdown_button_->SetIcon(
- new_state == PUSHED ? gfx::VectorIconId::FIND_NEXT
- : gfx::VectorIconId::FIND_PREV,
- base::Bind(&DownloadItemViewMd::GetTextColor, base::Unretained(this)));
+ dropdown_button_->SetIcon(new_state == PUSHED ? gfx::VectorIconId::FIND_NEXT
+ : gfx::VectorIconId::FIND_PREV);
if (new_state != dropdown_state_) {
dropdown_button_->AnimateInkDrop(new_state == PUSHED
? views::InkDropState::ACTIVATED

Powered by Google App Engine
This is Rietveld 408576698