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

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

Issue 1926943002: Introduce new flag to control usage of MD in secondary (not top-chrome) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: improve docs 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 930 matching lines...) Expand 10 before | Expand all | Expand 10 after
941 // to the user, so we start a new SamplingEvent and track it. 941 // to the user, so we start a new SamplingEvent and track it.
942 std::string event_name = model_.MightBeMalicious() 942 std::string event_name = model_.MightBeMalicious()
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::CreateStandardButton( 951 save_button_ = views::MdTextButton::CreateMdButton(
952 this, model_.GetWarningConfirmButtonText()); 952 this, model_.GetWarningConfirmButtonText());
953 save_button_->SetStyle(views::Button::STYLE_BUTTON); 953 save_button_->SetStyle(views::Button::STYLE_BUTTON);
954 AddChildView(save_button_); 954 AddChildView(save_button_);
955 } 955 }
956 int discard_button_message = 956 int discard_button_message =
957 model_.IsMalicious() ? IDS_DISMISS_DOWNLOAD : IDS_DISCARD_DOWNLOAD; 957 model_.IsMalicious() ? IDS_DISMISS_DOWNLOAD : IDS_DISCARD_DOWNLOAD;
958 discard_button_ = views::MdTextButton::CreateStandardButton( 958 discard_button_ = views::MdTextButton::CreateMdButton(
959 this, l10n_util::GetStringUTF16(discard_button_message)); 959 this, l10n_util::GetStringUTF16(discard_button_message));
960 discard_button_->SetStyle(views::Button::STYLE_BUTTON); 960 discard_button_->SetStyle(views::Button::STYLE_BUTTON);
961 AddChildView(discard_button_); 961 AddChildView(discard_button_);
962 962
963 base::string16 dangerous_label = 963 base::string16 dangerous_label =
964 model_.GetWarningText(font_list_, kTextWidth); 964 model_.GetWarningText(font_list_, kTextWidth);
965 dangerous_download_label_ = new views::Label(dangerous_label); 965 dangerous_download_label_ = new views::Label(dangerous_label);
966 dangerous_download_label_->SetMultiLine(true); 966 dangerous_download_label_->SetMultiLine(true);
967 dangerous_download_label_->SetHorizontalAlignment(gfx::ALIGN_LEFT); 967 dangerous_download_label_->SetHorizontalAlignment(gfx::ALIGN_LEFT);
968 dangerous_download_label_->SetAutoColorReadabilityEnabled(false); 968 dangerous_download_label_->SetAutoColorReadabilityEnabled(false);
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after
1117 SchedulePaint(); 1117 SchedulePaint();
1118 } 1118 }
1119 1119
1120 SkColor DownloadItemViewMd::GetTextColor() const { 1120 SkColor DownloadItemViewMd::GetTextColor() const {
1121 return GetTextColorForThemeProvider(GetThemeProvider()); 1121 return GetTextColorForThemeProvider(GetThemeProvider());
1122 } 1122 }
1123 1123
1124 SkColor DownloadItemViewMd::GetDimmedTextColor() const { 1124 SkColor DownloadItemViewMd::GetDimmedTextColor() const {
1125 return SkColorSetA(GetTextColor(), 0xC7); 1125 return SkColorSetA(GetTextColor(), 0xC7);
1126 } 1126 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698