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

Side by Side Diff: chrome/browser/ui/browser.cc

Issue 966983002: downloads: clicking "remove" on chrome://downloads should also hide shelf item. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: slimmer Created 5 years, 9 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 2012 The Chromium Authors. All rights reserved. 1 // Copyright 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/browser.h" 5 #include "chrome/browser/ui/browser.h"
6 6
7 #if defined(OS_WIN) 7 #if defined(OS_WIN)
8 #include <windows.h> 8 #include <windows.h>
9 #include <shellapi.h> 9 #include <shellapi.h>
10 #endif // defined(OS_WIN) 10 #endif // defined(OS_WIN)
(...skipping 1321 matching lines...) Expand 10 before | Expand all | Expand 10 after
1332 TabStripModel::kNoTab && 1332 TabStripModel::kNoTab &&
1333 !download->IsSavePackageDownload()) { 1333 !download->IsSavePackageDownload()) {
1334 CloseContents(source); 1334 CloseContents(source);
1335 } 1335 }
1336 1336
1337 // Some (app downloads) are not supposed to appear on the shelf. 1337 // Some (app downloads) are not supposed to appear on the shelf.
1338 if (!DownloadItemModel(download).ShouldShowInShelf()) 1338 if (!DownloadItemModel(download).ShouldShowInShelf())
1339 return; 1339 return;
1340 1340
1341 // GetDownloadShelf creates the download shelf if it was not yet created. 1341 // GetDownloadShelf creates the download shelf if it was not yet created.
1342 DownloadShelf* shelf = window()->GetDownloadShelf(); 1342 window()->GetDownloadShelf()->AddDownload(download);
Dan Beam 2015/03/02 18:50:09 shaves a line, didn't really see the point to crea
1343 shelf->AddDownload(download);
1344 } 1343 }
1345 1344
1346 /////////////////////////////////////////////////////////////////////////////// 1345 ///////////////////////////////////////////////////////////////////////////////
1347 // Browser, content::WebContentsDelegate implementation: 1346 // Browser, content::WebContentsDelegate implementation:
1348 1347
1349 WebContents* Browser::OpenURLFromTab(WebContents* source, 1348 WebContents* Browser::OpenURLFromTab(WebContents* source,
1350 const OpenURLParams& params) { 1349 const OpenURLParams& params) {
1351 chrome::NavigateParams nav_params(this, params.url, params.transition); 1350 chrome::NavigateParams nav_params(this, params.url, params.transition);
1352 FillNavigateParamsFromOpenURLParams(&nav_params, params); 1351 FillNavigateParamsFromOpenURLParams(&nav_params, params);
1353 nav_params.source_contents = source; 1352 nav_params.source_contents = source;
(...skipping 1184 matching lines...) Expand 10 before | Expand all | Expand 10 after
2538 if (contents && !allow_js_access) { 2537 if (contents && !allow_js_access) {
2539 contents->web_contents()->GetController().LoadURL( 2538 contents->web_contents()->GetController().LoadURL(
2540 target_url, 2539 target_url,
2541 content::Referrer(), 2540 content::Referrer(),
2542 ui::PAGE_TRANSITION_LINK, 2541 ui::PAGE_TRANSITION_LINK,
2543 std::string()); // No extra headers. 2542 std::string()); // No extra headers.
2544 } 2543 }
2545 2544
2546 return contents != NULL; 2545 return contents != NULL;
2547 } 2546 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698