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

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

Issue 2744463002: Add VectorIconButton functionality to ImageButton. (Closed)
Patch Set: check details 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
« no previous file with comments | « chrome/browser/ui/views/download/download_shelf_view.h ('k') | chrome/browser/ui/views/find_bar_view.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/views/download/download_shelf_view.cc
diff --git a/chrome/browser/ui/views/download/download_shelf_view.cc b/chrome/browser/ui/views/download/download_shelf_view.cc
index 23b32978b9c7f763f8fb1da9c346a56a417695ee..f90fac85417cec409117a88d4cfd69dfbc0a35f4 100644
--- a/chrome/browser/ui/views/download/download_shelf_view.cc
+++ b/chrome/browser/ui/views/download/download_shelf_view.cc
@@ -34,8 +34,9 @@
#include "ui/vector_icons/vector_icons.h"
#include "ui/views/background.h"
#include "ui/views/border.h"
+#include "ui/views/controls/button/image_button.h"
+#include "ui/views/controls/button/image_button_factory.h"
#include "ui/views/controls/button/md_text_button.h"
-#include "ui/views/controls/button/vector_icon_button.h"
#include "ui/views/controls/link.h"
#include "ui/views/mouse_watcher_view_host.h"
@@ -95,7 +96,7 @@ DownloadShelfView::DownloadShelfView(Browser* browser, BrowserView* parent)
new_item_animation_(this),
shelf_animation_(this),
show_all_view_(nullptr),
- close_button_(nullptr),
+ close_button_(views::CreateVectorImageButton(this)),
parent_(parent),
mouse_watcher_(new views::MouseWatcherViewHost(this, gfx::Insets()),
this) {
@@ -112,9 +113,6 @@ DownloadShelfView::DownloadShelfView(Browser* browser, BrowserView* parent)
this, l10n_util::GetStringUTF16(IDS_SHOW_ALL_DOWNLOADS));
AddChildView(show_all_view_);
- views::VectorIconButton* close_button = new views::VectorIconButton(this);
- close_button->SetIcon(ui::kCloseIcon);
- close_button_ = close_button;
close_button_->SetAccessibleName(
l10n_util::GetStringUTF16(IDS_ACCNAME_CLOSE));
AddChildView(close_button_);
@@ -335,6 +333,10 @@ void DownloadShelfView::UpdateColorsFromTheme() {
set_background(views::Background::CreateSolidBackground(
GetThemeProvider()->GetColor(ThemeProperties::COLOR_TOOLBAR)));
+
+ views::SetImageFromVectorIcon(
+ close_button_, ui::kCloseIcon,
+ DownloadItemView::GetTextColorForThemeProvider(GetThemeProvider()));
}
void DownloadShelfView::OnThemeChanged() {
@@ -355,10 +357,6 @@ void DownloadShelfView::ButtonPressed(
NOTREACHED();
}
-SkColor DownloadShelfView::GetVectorIconBaseColor() const {
- return DownloadItemView::GetTextColorForThemeProvider(GetThemeProvider());
-}
-
bool DownloadShelfView::IsShowing() const {
return visible() && shelf_animation_.IsShowing();
}
« no previous file with comments | « chrome/browser/ui/views/download/download_shelf_view.h ('k') | chrome/browser/ui/views/find_bar_view.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698