diff options
author | dpolukhin@chromium.org <dpolukhin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-04-08 11:29:53 +0000 |
---|---|---|
committer | dpolukhin@chromium.org <dpolukhin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-04-08 11:29:53 +0000 |
commit | cf5fa6bac12ad28a32eaa87d907da84a255a97bf (patch) | |
tree | f067dc488a8d7f20b7374f9c6fe9a1e5088ba179 /chrome/browser/browser_about_handler.cc | |
parent | afe55b7b16ca953ca4a0eb8aa46de2c4614ecc1c (diff) | |
download | chromium_src-cf5fa6bac12ad28a32eaa87d907da84a255a97bf.zip chromium_src-cf5fa6bac12ad28a32eaa87d907da84a255a97bf.tar.gz chromium_src-cf5fa6bac12ad28a32eaa87d907da84a255a97bf.tar.bz2 |
Load EULA from resources only on UI thread for Chrome OS
BUG=chromium-os:13838
TEST=manual
Review URL: http://codereview.chromium.org/6801069
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@80920 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/browser_about_handler.cc')
-rw-r--r-- | chrome/browser/browser_about_handler.cc | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/chrome/browser/browser_about_handler.cc b/chrome/browser/browser_about_handler.cc index 2b12494..958fe56 100644 --- a/chrome/browser/browser_about_handler.cc +++ b/chrome/browser/browser_about_handler.cc @@ -293,9 +293,9 @@ class ChromeOSTermsHandler // No EULA for given language - try en-US as default. path = StringPrintf(kEULAPathFormat, "en-US"); if (!file_util::ReadFileToString(FilePath(path), &contents_)) { - // Last resort use EULA from resources. - contents_ = ResourceBundle::GetSharedInstance().GetRawDataResource( - IDR_TERMS_HTML).as_string(); + // File with EULA not found, ResponseOnUIThread will load EULA from + // resources if contents_ is empty. + contents_.clear(); } } BrowserThread::PostTask( @@ -305,6 +305,10 @@ class ChromeOSTermsHandler void ResponseOnUIThread() { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); + if (contents_.empty()) { + contents_ = ResourceBundle::GetSharedInstance().GetRawDataResource( + IDR_TERMS_HTML).as_string(); + } source_->FinishDataRequest(contents_, request_id_); } |