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 <algorithm> | 7 #include <algorithm> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 308 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
319 parent()->SchedulePaint(); | 319 parent()->SchedulePaint(); |
320 } | 320 } |
321 | 321 |
322 void DownloadItemView::OnDownloadOpened(DownloadItem* download) { | 322 void DownloadItemView::OnDownloadOpened(DownloadItem* download) { |
323 disabled_while_opening_ = true; | 323 disabled_while_opening_ = true; |
324 SetEnabled(false); | 324 SetEnabled(false); |
325 MessageLoop::current()->PostDelayedTask( | 325 MessageLoop::current()->PostDelayedTask( |
326 FROM_HERE, | 326 FROM_HERE, |
327 base::Bind(&DownloadItemView::Reenable, | 327 base::Bind(&DownloadItemView::Reenable, |
328 weak_ptr_factory_.GetWeakPtr()), | 328 weak_ptr_factory_.GetWeakPtr()), |
329 kDisabledOnOpenDuration); | 329 base::TimeDelta::FromMilliseconds(kDisabledOnOpenDuration)); |
330 | 330 |
331 // Notify our parent. | 331 // Notify our parent. |
332 parent_->OpenedDownload(this); | 332 parent_->OpenedDownload(this); |
333 } | 333 } |
334 | 334 |
335 // View overrides | 335 // View overrides |
336 | 336 |
337 // In dangerous mode we have to layout our buttons. | 337 // In dangerous mode we have to layout our buttons. |
338 void DownloadItemView::Layout() { | 338 void DownloadItemView::Layout() { |
339 if (IsShowingWarningDialog()) { | 339 if (IsShowingWarningDialog()) { |
(...skipping 837 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1177 // Drop down button is glued to the left of the download shelf. | 1177 // Drop down button is glued to the left of the download shelf. |
1178 drop_down_x_left_ = 0; | 1178 drop_down_x_left_ = 0; |
1179 drop_down_x_right_ = normal_drop_down_image_set_.top->width(); | 1179 drop_down_x_right_ = normal_drop_down_image_set_.top->width(); |
1180 } else { | 1180 } else { |
1181 // Drop down button is glued to the right of the download shelf. | 1181 // Drop down button is glued to the right of the download shelf. |
1182 drop_down_x_left_ = | 1182 drop_down_x_left_ = |
1183 size.width() - normal_drop_down_image_set_.top->width(); | 1183 size.width() - normal_drop_down_image_set_.top->width(); |
1184 drop_down_x_right_ = size.width(); | 1184 drop_down_x_right_ = size.width(); |
1185 } | 1185 } |
1186 } | 1186 } |
OLD | NEW |