| OLD | NEW |
| 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 926 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 937 // to the user, so we start a new SamplingEvent and track it. | 937 // to the user, so we start a new SamplingEvent and track it. |
| 938 std::string event_name = model_.MightBeMalicious() | 938 std::string event_name = model_.MightBeMalicious() |
| 939 ? ExperienceSamplingEvent::kMaliciousDownload | 939 ? ExperienceSamplingEvent::kMaliciousDownload |
| 940 : ExperienceSamplingEvent::kDangerousDownload; | 940 : ExperienceSamplingEvent::kDangerousDownload; |
| 941 sampling_event_.reset(new ExperienceSamplingEvent( | 941 sampling_event_.reset(new ExperienceSamplingEvent( |
| 942 event_name, download()->GetURL(), download()->GetReferrerUrl(), | 942 event_name, download()->GetURL(), download()->GetReferrerUrl(), |
| 943 download()->GetBrowserContext())); | 943 download()->GetBrowserContext())); |
| 944 | 944 |
| 945 dropdown_state_ = NORMAL; | 945 dropdown_state_ = NORMAL; |
| 946 if (mode_ == DANGEROUS_MODE) { | 946 if (mode_ == DANGEROUS_MODE) { |
| 947 save_button_ = views::MdTextButton::CreateStandardButton( | 947 save_button_ = views::MdTextButton::CreateMdButton( |
| 948 this, model_.GetWarningConfirmButtonText()); | 948 this, model_.GetWarningConfirmButtonText()); |
| 949 save_button_->SetStyle(views::Button::STYLE_BUTTON); | 949 save_button_->SetStyle(views::Button::STYLE_BUTTON); |
| 950 AddChildView(save_button_); | 950 AddChildView(save_button_); |
| 951 } | 951 } |
| 952 int discard_button_message = | 952 int discard_button_message = |
| 953 model_.IsMalicious() ? IDS_DISMISS_DOWNLOAD : IDS_DISCARD_DOWNLOAD; | 953 model_.IsMalicious() ? IDS_DISMISS_DOWNLOAD : IDS_DISCARD_DOWNLOAD; |
| 954 discard_button_ = views::MdTextButton::CreateStandardButton( | 954 discard_button_ = views::MdTextButton::CreateMdButton( |
| 955 this, l10n_util::GetStringUTF16(discard_button_message)); | 955 this, l10n_util::GetStringUTF16(discard_button_message)); |
| 956 discard_button_->SetStyle(views::Button::STYLE_BUTTON); | 956 discard_button_->SetStyle(views::Button::STYLE_BUTTON); |
| 957 AddChildView(discard_button_); | 957 AddChildView(discard_button_); |
| 958 | 958 |
| 959 base::string16 dangerous_label = | 959 base::string16 dangerous_label = |
| 960 model_.GetWarningText(font_list_, kTextWidth); | 960 model_.GetWarningText(font_list_, kTextWidth); |
| 961 dangerous_download_label_ = new views::Label(dangerous_label); | 961 dangerous_download_label_ = new views::Label(dangerous_label); |
| 962 dangerous_download_label_->SetMultiLine(true); | 962 dangerous_download_label_->SetMultiLine(true); |
| 963 dangerous_download_label_->SetHorizontalAlignment(gfx::ALIGN_LEFT); | 963 dangerous_download_label_->SetHorizontalAlignment(gfx::ALIGN_LEFT); |
| 964 dangerous_download_label_->SetAutoColorReadabilityEnabled(false); | 964 dangerous_download_label_->SetAutoColorReadabilityEnabled(false); |
| (...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1113 SchedulePaint(); | 1113 SchedulePaint(); |
| 1114 } | 1114 } |
| 1115 | 1115 |
| 1116 SkColor DownloadItemViewMd::GetTextColor() const { | 1116 SkColor DownloadItemViewMd::GetTextColor() const { |
| 1117 return GetTextColorForThemeProvider(GetThemeProvider()); | 1117 return GetTextColorForThemeProvider(GetThemeProvider()); |
| 1118 } | 1118 } |
| 1119 | 1119 |
| 1120 SkColor DownloadItemViewMd::GetDimmedTextColor() const { | 1120 SkColor DownloadItemViewMd::GetDimmedTextColor() const { |
| 1121 return SkColorSetA(GetTextColor(), 0xC7); | 1121 return SkColorSetA(GetTextColor(), 0xC7); |
| 1122 } | 1122 } |
| OLD | NEW |