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

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

Issue 1958453002: Update some secondary UI buttons to MD style. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 4 years, 7 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 <stddef.h> 7 #include <stddef.h>
8 8
9 #include <algorithm> 9 #include <algorithm>
10 #include <vector> 10 #include <vector>
(...skipping 932 matching lines...) Expand 10 before | Expand all | Expand 10 after
943 ? ExperienceSamplingEvent::kMaliciousDownload 943 ? ExperienceSamplingEvent::kMaliciousDownload
944 : ExperienceSamplingEvent::kDangerousDownload; 944 : ExperienceSamplingEvent::kDangerousDownload;
945 sampling_event_.reset(new ExperienceSamplingEvent( 945 sampling_event_.reset(new ExperienceSamplingEvent(
946 event_name, download()->GetURL(), download()->GetReferrerUrl(), 946 event_name, download()->GetURL(), download()->GetReferrerUrl(),
947 download()->GetBrowserContext())); 947 download()->GetBrowserContext()));
948 948
949 dropdown_state_ = NORMAL; 949 dropdown_state_ = NORMAL;
950 if (mode_ == DANGEROUS_MODE) { 950 if (mode_ == DANGEROUS_MODE) {
951 save_button_ = views::MdTextButton::CreateMdButton( 951 save_button_ = views::MdTextButton::CreateMdButton(
952 this, model_.GetWarningConfirmButtonText()); 952 this, model_.GetWarningConfirmButtonText());
953 save_button_->SetStyle(views::Button::STYLE_BUTTON);
954 AddChildView(save_button_); 953 AddChildView(save_button_);
955 } 954 }
956 int discard_button_message = 955 int discard_button_message =
957 model_.IsMalicious() ? IDS_DISMISS_DOWNLOAD : IDS_DISCARD_DOWNLOAD; 956 model_.IsMalicious() ? IDS_DISMISS_DOWNLOAD : IDS_DISCARD_DOWNLOAD;
958 discard_button_ = views::MdTextButton::CreateMdButton( 957 discard_button_ = views::MdTextButton::CreateMdButton(
959 this, l10n_util::GetStringUTF16(discard_button_message)); 958 this, l10n_util::GetStringUTF16(discard_button_message));
960 discard_button_->SetStyle(views::Button::STYLE_BUTTON);
961 AddChildView(discard_button_); 959 AddChildView(discard_button_);
962 960
963 base::string16 dangerous_label = 961 base::string16 dangerous_label =
964 model_.GetWarningText(font_list_, kTextWidth); 962 model_.GetWarningText(font_list_, kTextWidth);
965 dangerous_download_label_ = new views::Label(dangerous_label); 963 dangerous_download_label_ = new views::Label(dangerous_label);
966 dangerous_download_label_->SetMultiLine(true); 964 dangerous_download_label_->SetMultiLine(true);
967 dangerous_download_label_->SetHorizontalAlignment(gfx::ALIGN_LEFT); 965 dangerous_download_label_->SetHorizontalAlignment(gfx::ALIGN_LEFT);
968 dangerous_download_label_->SetAutoColorReadabilityEnabled(false); 966 dangerous_download_label_->SetAutoColorReadabilityEnabled(false);
969 AddChildView(dangerous_download_label_); 967 AddChildView(dangerous_download_label_);
970 SizeLabelToMinWidth(); 968 SizeLabelToMinWidth();
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after
1117 SchedulePaint(); 1115 SchedulePaint();
1118 } 1116 }
1119 1117
1120 SkColor DownloadItemViewMd::GetTextColor() const { 1118 SkColor DownloadItemViewMd::GetTextColor() const {
1121 return GetTextColorForThemeProvider(GetThemeProvider()); 1119 return GetTextColorForThemeProvider(GetThemeProvider());
1122 } 1120 }
1123 1121
1124 SkColor DownloadItemViewMd::GetDimmedTextColor() const { 1122 SkColor DownloadItemViewMd::GetDimmedTextColor() const {
1125 return SkColorSetA(GetTextColor(), 0xC7); 1123 return SkColorSetA(GetTextColor(), 0xC7);
1126 } 1124 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698