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

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

Issue 14990003: CrOS online EULA: support localization, change timeout (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Removed client-server mapping Created 7 years, 7 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 | « chrome/app/chromeos_strings.grdp ('k') | chrome/common/url_constants.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 5e5c545e8c504c1cc0b0534a60aeb15705d5ddd7..58701b6e3976b166ce7a05335a54e3966b662bbe 100644
--- a/chrome/browser/ui/webui/about_ui.cc
+++ b/chrome/browser/ui/webui/about_ui.cc
@@ -103,7 +103,7 @@ const char kMemoryCssPath[] = "about_memory.css";
const char kStatsJsPath[] = "stats.js";
const char kStringsJsPath[] = "strings.js";
// chrome://terms falls back to offline page after kOnlineTermsTimeoutSec.
-const int kOnlineTermsTimeoutSec = 10;
+const int kOnlineTermsTimeoutSec = 7;
// When you type about:memory, it actually loads this intermediate URL that
// redirects you to the final page. This avoids the problem where typing
@@ -145,18 +145,21 @@ class AboutMemoryHandler : public MemoryDetails {
};
#if defined(OS_CHROMEOS)
+
// Helper class that fetches the online Chrome OS terms. Empty string is
// returned once fetching failed or exceeded |kOnlineTermsTimeoutSec|.
class ChromeOSOnlineTermsHandler : public net::URLFetcherDelegate {
public:
typedef base::Callback<void (ChromeOSOnlineTermsHandler*)> FetchCallback;
- explicit ChromeOSOnlineTermsHandler(const FetchCallback& callback)
+ explicit ChromeOSOnlineTermsHandler(const FetchCallback& callback,
+ const std::string& locale)
: fetch_callback_(callback) {
- eula_fetcher_.reset(net::URLFetcher::Create(
- GURL(l10n_util::GetStringUTF16(IDS_EULA_POLICY_URL)),
- net::URLFetcher::GET,
- this));
+ std::string eula_URL = base::StringPrintf(chrome::kOnlineEulaURLPath,
Evan Stade 2013/05/07 21:52:17 I thought the idea was to rely on acceptlanguages
vasilii 2013/05/08 07:36:30 No, they have prepared a list of URL in Chrome for
+ locale.c_str());
+ eula_fetcher_.reset(net::URLFetcher::Create(GURL(eula_URL),
+ net::URLFetcher::GET,
+ this));
eula_fetcher_->SetRequestContext(
g_browser_process->system_request_context());
eula_fetcher_->AddExtraRequestHeader("Accept: text/html");
@@ -257,7 +260,8 @@ class ChromeOSTermsHandler
// Try to load online version of ChromeOS terms first.
// ChromeOSOnlineTermsHandler object destroys itself.
new ChromeOSOnlineTermsHandler(
- base::Bind(&ChromeOSTermsHandler::OnOnlineEULAFetched, this));
+ base::Bind(&ChromeOSTermsHandler::OnOnlineEULAFetched, this),
+ locale_);
}
}
« no previous file with comments | « chrome/app/chromeos_strings.grdp ('k') | chrome/common/url_constants.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698