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

Side by Side Diff: chrome/browser/extensions/api/downloads/downloads_api.cc

Issue 1637943003: Remove HostDesktopType from BrowserList::GetInstance() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@screen-wrapper-land
Patch Set: Created 4 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/extensions/api/downloads/downloads_api.h" 5 #include "chrome/browser/extensions/api/downloads/downloads_api.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 #include <set> 9 #include <set>
10 #include <string> 10 #include <string>
(...skipping 1411 matching lines...) Expand 10 before | Expand all | Expand 10 after
1422 service->GetExtensionEventRouter()->SetShelfEnabled(extension(), 1422 service->GetExtensionEventRouter()->SetShelfEnabled(extension(),
1423 params->enabled); 1423 params->enabled);
1424 } 1424 }
1425 if (incognito_manager) { 1425 if (incognito_manager) {
1426 incognito_service = DownloadServiceFactory::GetForBrowserContext( 1426 incognito_service = DownloadServiceFactory::GetForBrowserContext(
1427 incognito_manager->GetBrowserContext()); 1427 incognito_manager->GetBrowserContext());
1428 incognito_service->GetExtensionEventRouter()->SetShelfEnabled( 1428 incognito_service->GetExtensionEventRouter()->SetShelfEnabled(
1429 extension(), params->enabled); 1429 extension(), params->enabled);
1430 } 1430 }
1431 1431
1432 BrowserList* browsers = BrowserList::GetInstance(chrome::GetActiveDesktop()); 1432 BrowserList* browsers = BrowserList::GetInstance();
1433 if (browsers) { 1433 if (browsers) {
1434 for (BrowserList::const_iterator iter = browsers->begin(); 1434 for (BrowserList::const_iterator iter = browsers->begin();
1435 iter != browsers->end(); ++iter) { 1435 iter != browsers->end(); ++iter) {
1436 const Browser* browser = *iter; 1436 const Browser* browser = *iter;
1437 DownloadService* current_service = 1437 DownloadService* current_service =
1438 DownloadServiceFactory::GetForBrowserContext(browser->profile()); 1438 DownloadServiceFactory::GetForBrowserContext(browser->profile());
1439 if (((current_service == service) || 1439 if (((current_service == service) ||
1440 (current_service == incognito_service)) && 1440 (current_service == incognito_service)) &&
1441 browser->window()->IsDownloadShelfVisible() && 1441 browser->window()->IsDownloadShelfVisible() &&
1442 !current_service->IsShelfEnabled()) 1442 !current_service->IsShelfEnabled())
(...skipping 460 matching lines...) Expand 10 before | Expand all | Expand 10 after
1903 return; 1903 return;
1904 base::Time now(base::Time::Now()); 1904 base::Time now(base::Time::Now());
1905 int delta = now.ToTimeT() - last_checked_removal_.ToTimeT(); 1905 int delta = now.ToTimeT() - last_checked_removal_.ToTimeT();
1906 if (delta <= kFileExistenceRateLimitSeconds) 1906 if (delta <= kFileExistenceRateLimitSeconds)
1907 return; 1907 return;
1908 last_checked_removal_ = now; 1908 last_checked_removal_ = now;
1909 manager->CheckForHistoryFilesRemoval(); 1909 manager->CheckForHistoryFilesRemoval();
1910 } 1910 }
1911 1911
1912 } // namespace extensions 1912 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698