| 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 315 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 326 | 326 | 
| 327 void DownloadItemView::OnDownloadOpened(DownloadItem* download) { | 327 void DownloadItemView::OnDownloadOpened(DownloadItem* download) { | 
| 328   disabled_while_opening_ = true; | 328   disabled_while_opening_ = true; | 
| 329   SetEnabled(false); | 329   SetEnabled(false); | 
| 330   base::ThreadTaskRunnerHandle::Get()->PostDelayedTask( | 330   base::ThreadTaskRunnerHandle::Get()->PostDelayedTask( | 
| 331       FROM_HERE, | 331       FROM_HERE, | 
| 332       base::Bind(&DownloadItemView::Reenable, weak_ptr_factory_.GetWeakPtr()), | 332       base::Bind(&DownloadItemView::Reenable, weak_ptr_factory_.GetWeakPtr()), | 
| 333       base::TimeDelta::FromMilliseconds(kDisabledOnOpenDuration)); | 333       base::TimeDelta::FromMilliseconds(kDisabledOnOpenDuration)); | 
| 334 | 334 | 
| 335   // Notify our parent. | 335   // Notify our parent. | 
| 336   shelf_->OpenedDownload(); | 336   shelf_->OnDownloadOpened(); | 
|  | 337 } | 
|  | 338 | 
|  | 339 void DownloadItemView::OnDownloadShown(DownloadItem* download) { | 
|  | 340   // Notify our parent. | 
|  | 341   shelf_->OnDownloadShown(); | 
| 337 } | 342 } | 
| 338 | 343 | 
| 339 // View overrides | 344 // View overrides | 
| 340 | 345 | 
| 341 // In dangerous mode we have to layout our buttons. | 346 // In dangerous mode we have to layout our buttons. | 
| 342 void DownloadItemView::Layout() { | 347 void DownloadItemView::Layout() { | 
| 343   UpdateColorsFromTheme(); | 348   UpdateColorsFromTheme(); | 
| 344 | 349 | 
| 345   if (IsShowingWarningDialog()) { | 350   if (IsShowingWarningDialog()) { | 
| 346     gfx::Point child_origin( | 351     gfx::Point child_origin( | 
| (...skipping 761 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 1108     SchedulePaint(); | 1113     SchedulePaint(); | 
| 1109 } | 1114 } | 
| 1110 | 1115 | 
| 1111 SkColor DownloadItemView::GetTextColor() const { | 1116 SkColor DownloadItemView::GetTextColor() const { | 
| 1112   return GetTextColorForThemeProvider(GetThemeProvider()); | 1117   return GetTextColorForThemeProvider(GetThemeProvider()); | 
| 1113 } | 1118 } | 
| 1114 | 1119 | 
| 1115 SkColor DownloadItemView::GetDimmedTextColor() const { | 1120 SkColor DownloadItemView::GetDimmedTextColor() const { | 
| 1116   return SkColorSetA(GetTextColor(), 0xC7); | 1121   return SkColorSetA(GetTextColor(), 0xC7); | 
| 1117 } | 1122 } | 
| OLD | NEW | 
|---|