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

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

Issue 786423002: Get rid of net::DO_NOT_PROMPT_FOR_LOGIN (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: delete flag from iOS code Created 5 years, 11 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
« no previous file with comments | « no previous file | components/captive_portal/captive_portal_detector.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 <set> 7 #include <set>
8 #include <string> 8 #include <string>
9 9
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
(...skipping 994 matching lines...) Expand 10 before | Expand all | Expand 10 after
1005 std::string method_string = 1005 std::string method_string =
1006 downloads::ToString(options.method); 1006 downloads::ToString(options.method);
1007 if (!method_string.empty()) 1007 if (!method_string.empty())
1008 download_params->set_method(method_string); 1008 download_params->set_method(method_string);
1009 if (options.body.get()) 1009 if (options.body.get())
1010 download_params->set_post_body(*options.body.get()); 1010 download_params->set_post_body(*options.body.get());
1011 download_params->set_callback(base::Bind( 1011 download_params->set_callback(base::Bind(
1012 &DownloadsDownloadFunction::OnStarted, this, 1012 &DownloadsDownloadFunction::OnStarted, this,
1013 creator_suggested_filename, options.conflict_action)); 1013 creator_suggested_filename, options.conflict_action));
1014 // Prevent login prompts for 401/407 responses. 1014 // Prevent login prompts for 401/407 responses.
1015 download_params->set_load_flags(net::LOAD_DO_NOT_PROMPT_FOR_LOGIN); 1015 download_params->set_do_not_prompt_for_login(true);
1016 1016
1017 DownloadManager* manager = BrowserContext::GetDownloadManager( 1017 DownloadManager* manager = BrowserContext::GetDownloadManager(
1018 current_profile); 1018 current_profile);
1019 manager->DownloadUrl(download_params.Pass()); 1019 manager->DownloadUrl(download_params.Pass());
1020 RecordDownloadSource(DOWNLOAD_INITIATED_BY_EXTENSION); 1020 RecordDownloadSource(DOWNLOAD_INITIATED_BY_EXTENSION);
1021 RecordApiFunctions(DOWNLOADS_FUNCTION_DOWNLOAD); 1021 RecordApiFunctions(DOWNLOADS_FUNCTION_DOWNLOAD);
1022 return true; 1022 return true;
1023 } 1023 }
1024 1024
1025 void DownloadsDownloadFunction::OnStarted( 1025 void DownloadsDownloadFunction::OnStarted(
(...skipping 874 matching lines...) Expand 10 before | Expand all | Expand 10 after
1900 return; 1900 return;
1901 base::Time now(base::Time::Now()); 1901 base::Time now(base::Time::Now());
1902 int delta = now.ToTimeT() - last_checked_removal_.ToTimeT(); 1902 int delta = now.ToTimeT() - last_checked_removal_.ToTimeT();
1903 if (delta <= kFileExistenceRateLimitSeconds) 1903 if (delta <= kFileExistenceRateLimitSeconds)
1904 return; 1904 return;
1905 last_checked_removal_ = now; 1905 last_checked_removal_ = now;
1906 manager->CheckForHistoryFilesRemoval(); 1906 manager->CheckForHistoryFilesRemoval();
1907 } 1907 }
1908 1908
1909 } // namespace extensions 1909 } // namespace extensions
OLDNEW
« no previous file with comments | « no previous file | components/captive_portal/captive_portal_detector.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698