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.h" | 5 #include "chrome/browser/ui/views/download/download_item_view.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 317 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
328 | 328 |
329 void DownloadItemView::OnDownloadDestroyed(DownloadItem* download) { | 329 void DownloadItemView::OnDownloadDestroyed(DownloadItem* download) { |
330 shelf_->RemoveDownloadView(this); // This will delete us! | 330 shelf_->RemoveDownloadView(this); // This will delete us! |
331 } | 331 } |
332 | 332 |
333 void DownloadItemView::OnDownloadOpened(DownloadItem* download) { | 333 void DownloadItemView::OnDownloadOpened(DownloadItem* download) { |
334 disabled_while_opening_ = true; | 334 disabled_while_opening_ = true; |
335 SetEnabled(false); | 335 SetEnabled(false); |
336 base::ThreadTaskRunnerHandle::Get()->PostDelayedTask( | 336 base::ThreadTaskRunnerHandle::Get()->PostDelayedTask( |
337 FROM_HERE, | 337 FROM_HERE, |
338 base::Bind(&DownloadItemView::Reenable, weak_ptr_factory_.GetWeakPtr()), | 338 base::BindOnce(&DownloadItemView::Reenable, |
| 339 weak_ptr_factory_.GetWeakPtr()), |
339 base::TimeDelta::FromMilliseconds(kDisabledOnOpenDuration)); | 340 base::TimeDelta::FromMilliseconds(kDisabledOnOpenDuration)); |
340 | 341 |
341 // Notify our parent. | 342 // Notify our parent. |
342 shelf_->OpenedDownload(); | 343 shelf_->OpenedDownload(); |
343 } | 344 } |
344 | 345 |
345 // View overrides | 346 // View overrides |
346 | 347 |
347 // In dangerous mode we have to layout our buttons. | 348 // In dangerous mode we have to layout our buttons. |
348 void DownloadItemView::Layout() { | 349 void DownloadItemView::Layout() { |
(...skipping 771 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1120 SchedulePaint(); | 1121 SchedulePaint(); |
1121 } | 1122 } |
1122 | 1123 |
1123 SkColor DownloadItemView::GetTextColor() const { | 1124 SkColor DownloadItemView::GetTextColor() const { |
1124 return GetTextColorForThemeProvider(GetThemeProvider()); | 1125 return GetTextColorForThemeProvider(GetThemeProvider()); |
1125 } | 1126 } |
1126 | 1127 |
1127 SkColor DownloadItemView::GetDimmedTextColor() const { | 1128 SkColor DownloadItemView::GetDimmedTextColor() const { |
1128 return SkColorSetA(GetTextColor(), 0xC7); | 1129 return SkColorSetA(GetTextColor(), 0xC7); |
1129 } | 1130 } |
OLD | NEW |