OLD | NEW |
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/ui/webui/about_ui.h" | 5 #include "chrome/browser/ui/webui/about_ui.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <string> | 8 #include <string> |
9 #include <utility> | 9 #include <utility> |
10 #include <vector> | 10 #include <vector> |
(...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
241 | 241 |
242 virtual ~ChromeOSTermsHandler() {} | 242 virtual ~ChromeOSTermsHandler() {} |
243 | 243 |
244 void StartOnUIThread() { | 244 void StartOnUIThread() { |
245 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 245 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
246 if (path_ == chrome::kOemEulaURLPath) { | 246 if (path_ == chrome::kOemEulaURLPath) { |
247 // Load local OEM EULA from the disk. | 247 // Load local OEM EULA from the disk. |
248 BrowserThread::PostTask( | 248 BrowserThread::PostTask( |
249 BrowserThread::FILE, FROM_HERE, | 249 BrowserThread::FILE, FROM_HERE, |
250 base::Bind(&ChromeOSTermsHandler::LoadOemEulaFileOnFileThread, this)); | 250 base::Bind(&ChromeOSTermsHandler::LoadOemEulaFileOnFileThread, this)); |
251 } else if (CommandLine::ForCurrentProcess()->HasSwitch( | |
252 chromeos::switches::kDisableOnlineEULA)) { | |
253 // Fallback to the local file. | |
254 BrowserThread::PostTask( | |
255 BrowserThread::FILE, FROM_HERE, | |
256 base::Bind(&ChromeOSTermsHandler::LoadEulaFileOnFileThread, this)); | |
257 } else { | 251 } else { |
258 // Try to load online version of ChromeOS terms first. | 252 // Try to load online version of ChromeOS terms first. |
259 // ChromeOSOnlineTermsHandler object destroys itself. | 253 // ChromeOSOnlineTermsHandler object destroys itself. |
260 new ChromeOSOnlineTermsHandler( | 254 new ChromeOSOnlineTermsHandler( |
261 base::Bind(&ChromeOSTermsHandler::OnOnlineEULAFetched, this), | 255 base::Bind(&ChromeOSTermsHandler::OnOnlineEULAFetched, this), |
262 locale_); | 256 locale_); |
263 } | 257 } |
264 } | 258 } |
265 | 259 |
266 void OnOnlineEULAFetched(ChromeOSOnlineTermsHandler* loader) { | 260 void OnOnlineEULAFetched(ChromeOSOnlineTermsHandler* loader) { |
(...skipping 820 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1087 Profile* profile = Profile::FromWebUI(web_ui); | 1081 Profile* profile = Profile::FromWebUI(web_ui); |
1088 | 1082 |
1089 #if defined(ENABLE_THEMES) | 1083 #if defined(ENABLE_THEMES) |
1090 // Set up the chrome://theme/ source. | 1084 // Set up the chrome://theme/ source. |
1091 ThemeSource* theme = new ThemeSource(profile); | 1085 ThemeSource* theme = new ThemeSource(profile); |
1092 content::URLDataSource::Add(profile, theme); | 1086 content::URLDataSource::Add(profile, theme); |
1093 #endif | 1087 #endif |
1094 | 1088 |
1095 content::URLDataSource::Add(profile, new AboutUIHTMLSource(name, profile)); | 1089 content::URLDataSource::Add(profile, new AboutUIHTMLSource(name, profile)); |
1096 } | 1090 } |
OLD | NEW |