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

Unified Diff: chrome/browser/ui/webui/about_ui.cc

Issue 14120009: Add a command line parameter to disable online EULA. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Addressed nit. Created 7 years, 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chromeos/chromeos_switches.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/webui/about_ui.cc
diff --git a/chrome/browser/ui/webui/about_ui.cc b/chrome/browser/ui/webui/about_ui.cc
index ff407b297b1419a2d7f9680ace03dfe9cdbf90eb..f2e4f6f0871ec2722630e6ba6dab8ee8c94db38e 100644
--- a/chrome/browser/ui/webui/about_ui.cc
+++ b/chrome/browser/ui/webui/about_ui.cc
@@ -54,6 +54,7 @@
#include "grit/generated_resources.h"
#include "grit/locale_settings.h"
#include "net/base/escape.h"
+#include "net/base/load_flags.h"
#include "net/base/net_util.h"
#include "net/http/http_response_headers.h"
#include "net/url_request/url_fetcher.h"
@@ -80,6 +81,7 @@
#include "chrome/browser/chromeos/customization_document.h"
#include "chrome/browser/chromeos/memory/oom_priority_manager.h"
#include "chrome/browser/ui/webui/chromeos/about_network.h"
+#include "chromeos/chromeos_switches.h"
#endif
#if defined(USE_ASH)
@@ -157,6 +159,9 @@ class ChromeOSOnlineTermsHandler : public net::URLFetcherDelegate {
eula_fetcher_->SetRequestContext(
g_browser_process->system_request_context());
eula_fetcher_->AddExtraRequestHeader("Accept: text/html");
+ eula_fetcher_->SetLoadFlags(net::LOAD_DO_NOT_SEND_COOKIES |
+ net::LOAD_DO_NOT_SAVE_COOKIES |
+ net::LOAD_DISABLE_CACHE);
eula_fetcher_->Start();
// Abort the download attempt if it takes longer than one minute.
download_timer_.Start(FROM_HERE,
@@ -241,6 +246,12 @@ class ChromeOSTermsHandler
BrowserThread::PostTask(
BrowserThread::FILE, FROM_HERE,
base::Bind(&ChromeOSTermsHandler::LoadOemEulaFileOnFileThread, this));
+ } else if (CommandLine::ForCurrentProcess()->HasSwitch(
+ chromeos::switches::kDisableOnlineEULA)) {
+ // Fallback to the local file.
+ BrowserThread::PostTask(
+ BrowserThread::FILE, FROM_HERE,
+ base::Bind(&ChromeOSTermsHandler::LoadEulaFileOnFileThread, this));
} else {
// Try to load online version of ChromeOS terms first.
// ChromeOSOnlineTermsHandler object destroys itself.
« no previous file with comments | « no previous file | chromeos/chromeos_switches.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698