Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(141)

Side by Side Diff: chrome/browser/ui/views/download/download_item_view.cc

Issue 209613002: Download shelf autohides on showing in shell, just same as regular open Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Added browser and unit tests. Renamed 'UserActed' to 'OpenedOrShown'. Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/download/download_item_view.h ('k') | chrome/browser/ui/views/download/download_shelf_view.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698