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

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

Issue 3177034: Makes the download shelf auto-close after the user opens all downloads (Closed)
Patch Set: Have OnDownloadOpened invoked before opened to match old behavior Created 10 years, 3 months 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) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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/views/download_item_view.h" 5 #include "chrome/browser/views/download_item_view.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "app/l10n_util.h" 9 #include "app/l10n_util.h"
10 #include "app/resource_bundle.h" 10 #include "app/resource_bundle.h"
(...skipping 375 matching lines...) Expand 10 before | Expand all | Expand 10 after
386 GetParent()->SchedulePaint(); 386 GetParent()->SchedulePaint();
387 } 387 }
388 388
389 void DownloadItemView::OnDownloadOpened(DownloadItem* download) { 389 void DownloadItemView::OnDownloadOpened(DownloadItem* download) {
390 disabled_while_opening_ = true; 390 disabled_while_opening_ = true;
391 SetEnabled(false); 391 SetEnabled(false);
392 MessageLoop::current()->PostDelayedTask( 392 MessageLoop::current()->PostDelayedTask(
393 FROM_HERE, 393 FROM_HERE,
394 reenable_method_factory_.NewRunnableMethod(&DownloadItemView::Reenable), 394 reenable_method_factory_.NewRunnableMethod(&DownloadItemView::Reenable),
395 kDisabledOnOpenDuration); 395 kDisabledOnOpenDuration);
396
397 // Notify our parent.
398 parent_->OpenedDownload(this);
396 } 399 }
397 400
398 // View overrides 401 // View overrides
399 402
400 // In dangerous mode we have to layout our buttons. 403 // In dangerous mode we have to layout our buttons.
401 void DownloadItemView::Layout() { 404 void DownloadItemView::Layout() {
402 if (IsDangerousMode()) { 405 if (IsDangerousMode()) {
403 dangerous_download_label_->SetColor( 406 dangerous_download_label_->SetColor(
404 GetThemeProvider()->GetColor(BrowserThemeProvider::COLOR_BOOKMARK_TEXT)); 407 GetThemeProvider()->GetColor(BrowserThemeProvider::COLOR_BOOKMARK_TEXT));
405 408
(...skipping 595 matching lines...) Expand 10 before | Expand all | Expand 10 after
1001 void DownloadItemView::Reenable() { 1004 void DownloadItemView::Reenable() {
1002 disabled_while_opening_ = false; 1005 disabled_while_opening_ = false;
1003 SetEnabled(true); // Triggers a repaint. 1006 SetEnabled(true); // Triggers a repaint.
1004 } 1007 }
1005 1008
1006 bool DownloadItemView::InDropDownButtonXCoordinateRange(int x) { 1009 bool DownloadItemView::InDropDownButtonXCoordinateRange(int x) {
1007 if (x > drop_down_x_left_ && x < drop_down_x_right_) 1010 if (x > drop_down_x_left_ && x < drop_down_x_right_)
1008 return true; 1011 return true;
1009 return false; 1012 return false;
1010 } 1013 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698