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

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

Issue 147593002: Implement new dangerous download reporting dialog for UNCOMMON_DOWNLOAD, in Views (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix typo Created 6 years, 10 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) 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 147 matching lines...) Expand 10 before | Expand all | Expand 10 after
158 158
159 void DownloadShelfView::OpenedDownload(DownloadItemView* view) { 159 void DownloadShelfView::OpenedDownload(DownloadItemView* view) {
160 if (CanAutoClose()) 160 if (CanAutoClose())
161 mouse_watcher_.Start(); 161 mouse_watcher_.Start();
162 } 162 }
163 163
164 content::PageNavigator* DownloadShelfView::GetNavigator() { 164 content::PageNavigator* DownloadShelfView::GetNavigator() {
165 return browser_; 165 return browser_;
166 } 166 }
167 167
168 BrowserView* DownloadShelfView::GetParentWindowView() {
169 return parent_;
170 }
171
168 gfx::Size DownloadShelfView::GetPreferredSize() { 172 gfx::Size DownloadShelfView::GetPreferredSize() {
169 gfx::Size prefsize(kRightPadding + kLeftPadding + kCloseAndLinkPadding, 0); 173 gfx::Size prefsize(kRightPadding + kLeftPadding + kCloseAndLinkPadding, 0);
170 AdjustSize(close_button_, &prefsize); 174 AdjustSize(close_button_, &prefsize);
171 AdjustSize(show_all_view_, &prefsize); 175 AdjustSize(show_all_view_, &prefsize);
172 // Add one download view to the preferred size. 176 // Add one download view to the preferred size.
173 if (!download_views_.empty()) { 177 if (!download_views_.empty()) {
174 AdjustSize(*download_views_.begin(), &prefsize); 178 AdjustSize(*download_views_.begin(), &prefsize);
175 prefsize.Enlarge(kDownloadPadding, 0); 179 prefsize.Enlarge(kDownloadPadding, 0);
176 } 180 }
177 prefsize.Enlarge(0, kTopBottomPadding + kTopBottomPadding); 181 prefsize.Enlarge(0, kTopBottomPadding + kTopBottomPadding);
(...skipping 236 matching lines...) Expand 10 before | Expand all | Expand 10 after
414 } 418 }
415 } 419 }
416 420
417 bool DownloadShelfView::CanAutoClose() { 421 bool DownloadShelfView::CanAutoClose() {
418 for (size_t i = 0; i < download_views_.size(); ++i) { 422 for (size_t i = 0; i < download_views_.size(); ++i) {
419 if (!download_views_[i]->download()->GetOpened()) 423 if (!download_views_[i]->download()->GetOpened())
420 return false; 424 return false;
421 } 425 }
422 return true; 426 return true;
423 } 427 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698