| 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_shelf_view.h" | 5 #include "chrome/browser/ui/views/download/download_shelf_view.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 112 this, l10n_util::GetStringUTF16(IDS_SHOW_ALL_DOWNLOADS)); | 112 this, l10n_util::GetStringUTF16(IDS_SHOW_ALL_DOWNLOADS)); |
| 113 AddChildView(show_all_view_); | 113 AddChildView(show_all_view_); |
| 114 | 114 |
| 115 views::VectorIconButton* close_button = new views::VectorIconButton(this); | 115 views::VectorIconButton* close_button = new views::VectorIconButton(this); |
| 116 close_button->SetIcon(gfx::VectorIconId::BAR_CLOSE); | 116 close_button->SetIcon(gfx::VectorIconId::BAR_CLOSE); |
| 117 close_button_ = close_button; | 117 close_button_ = close_button; |
| 118 close_button_->SetAccessibleName( | 118 close_button_->SetAccessibleName( |
| 119 l10n_util::GetStringUTF16(IDS_ACCNAME_CLOSE)); | 119 l10n_util::GetStringUTF16(IDS_ACCNAME_CLOSE)); |
| 120 AddChildView(close_button_); | 120 AddChildView(close_button_); |
| 121 | 121 |
| 122 new_item_animation_.SetSlideDuration(kNewItemAnimationDurationMs); | 122 new_item_animation_.SetSlideDuration(kNewItemAnimationDurationMs * 16); |
| 123 shelf_animation_.SetSlideDuration(kShelfAnimationDurationMs); | 123 shelf_animation_.SetSlideDuration(kShelfAnimationDurationMs); |
| 124 } | 124 } |
| 125 | 125 |
| 126 DownloadShelfView::~DownloadShelfView() { | 126 DownloadShelfView::~DownloadShelfView() { |
| 127 parent_->RemoveChildView(this); | 127 parent_->RemoveChildView(this); |
| 128 } | 128 } |
| 129 | 129 |
| 130 void DownloadShelfView::AddDownloadView(DownloadItemView* view) { | 130 void DownloadShelfView::AddDownloadView(DownloadItemView* view) { |
| 131 mouse_watcher_.Stop(); | 131 mouse_watcher_.Stop(); |
| 132 | 132 |
| (...skipping 280 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 413 SetVisible(false); | 413 SetVisible(false); |
| 414 } | 414 } |
| 415 | 415 |
| 416 bool DownloadShelfView::CanAutoClose() { | 416 bool DownloadShelfView::CanAutoClose() { |
| 417 for (size_t i = 0; i < download_views_.size(); ++i) { | 417 for (size_t i = 0; i < download_views_.size(); ++i) { |
| 418 if (!download_views_[i]->download()->GetOpened()) | 418 if (!download_views_[i]->download()->GetOpened()) |
| 419 return false; | 419 return false; |
| 420 } | 420 } |
| 421 return true; | 421 return true; |
| 422 } | 422 } |
| OLD | NEW |