Chromium Code Reviews| 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..da9752eaab31ca41ef4661dc1e2e6d0870904537 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, |
| @@ -242,10 +247,18 @@ class ChromeOSTermsHandler |
| BrowserThread::FILE, FROM_HERE, |
| base::Bind(&ChromeOSTermsHandler::LoadOemEulaFileOnFileThread, this)); |
| } else { |
|
Evan Stade
2013/04/23 18:50:05
this looks equivalent to
if {} else if {} else {}
|
| - // Try to load online version of ChromeOS terms first. |
| - // ChromeOSOnlineTermsHandler object destroys itself. |
| - new ChromeOSOnlineTermsHandler( |
| - base::Bind(&ChromeOSTermsHandler::OnOnlineEULAFetched, this)); |
| + 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. |
| + new ChromeOSOnlineTermsHandler( |
| + base::Bind(&ChromeOSTermsHandler::OnOnlineEULAFetched, this)); |
| + } |
| } |
| } |