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

Side by Side Diff: chrome/browser/ui/views/download/download_item_view_md.cc

Issue 1406613002: For some vector icons, get the size from the vector definition. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 2 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/ui/views/download/download_item_view_md.h" 5 #include "chrome/browser/ui/views/download/download_item_view_md.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 808 matching lines...) Expand 10 before | Expand all | Expand 10 after
819 } 819 }
820 820
821 void DownloadItemViewMd::SetDropdownState(State new_state) { 821 void DownloadItemViewMd::SetDropdownState(State new_state) {
822 // Avoid extra SchedulePaint()s if the state is going to be the same and 822 // Avoid extra SchedulePaint()s if the state is going to be the same and
823 // |dropdown_button_| has already been initialized. 823 // |dropdown_button_| has already been initialized.
824 if (dropdown_state_ == new_state && 824 if (dropdown_state_ == new_state &&
825 !dropdown_button_->GetImage(views::CustomButton::STATE_NORMAL).isNull()) 825 !dropdown_button_->GetImage(views::CustomButton::STATE_NORMAL).isNull())
826 return; 826 return;
827 827
828 // TODO(estade): theme this color instead of using a constant. 828 // TODO(estade): theme this color instead of using a constant.
829 gfx::ImageSkia image = 829 gfx::ImageSkia image = gfx::CreatePrimaryVectorIcon(
830 gfx::CreateVectorIcon(new_state == PUSHED ? gfx::VectorIconId::FIND_NEXT 830 new_state == PUSHED ? gfx::VectorIconId::FIND_NEXT
831 : gfx::VectorIconId::FIND_PREV, 831 : gfx::VectorIconId::FIND_PREV,
832 16, gfx::kChromeIconGrey); 832 gfx::kChromeIconGrey);
833 dropdown_button_->SetImage(views::CustomButton::STATE_NORMAL, &image); 833 dropdown_button_->SetImage(views::CustomButton::STATE_NORMAL, &image);
834 dropdown_state_ = new_state; 834 dropdown_state_ = new_state;
835 SchedulePaint(); 835 SchedulePaint();
836 } 836 }
837 837
838 void DownloadItemViewMd::ClearWarningDialog() { 838 void DownloadItemViewMd::ClearWarningDialog() {
839 DCHECK(download()->GetDangerType() == 839 DCHECK(download()->GetDangerType() ==
840 content::DOWNLOAD_DANGER_TYPE_USER_VALIDATED); 840 content::DOWNLOAD_DANGER_TYPE_USER_VALIDATED);
841 DCHECK(mode_ == DANGEROUS_MODE || mode_ == MALICIOUS_MODE); 841 DCHECK(mode_ == DANGEROUS_MODE || mode_ == MALICIOUS_MODE);
842 842
(...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after
1070 State to, 1070 State to,
1071 gfx::SlideAnimation* animation) { 1071 gfx::SlideAnimation* animation) {
1072 if (from == NORMAL && to == HOT) { 1072 if (from == NORMAL && to == HOT) {
1073 animation->Show(); 1073 animation->Show();
1074 } else if (from == HOT && to == NORMAL) { 1074 } else if (from == HOT && to == NORMAL) {
1075 animation->Hide(); 1075 animation->Hide();
1076 } else if (from != to) { 1076 } else if (from != to) {
1077 animation->Reset((to == HOT) ? 1.0 : 0.0); 1077 animation->Reset((to == HOT) ? 1.0 : 0.0);
1078 } 1078 }
1079 } 1079 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698