| 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 1023 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1034 idr = IDR_KEYBOARD_UTILS_JS; | 1034 idr = IDR_KEYBOARD_UTILS_JS; |
| 1035 response = ResourceBundle::GetSharedInstance().GetRawDataResource( | 1035 response = ResourceBundle::GetSharedInstance().GetRawDataResource( |
| 1036 idr).as_string(); | 1036 idr).as_string(); |
| 1037 #endif | 1037 #endif |
| 1038 #if defined(OS_LINUX) || defined(OS_OPENBSD) | 1038 #if defined(OS_LINUX) || defined(OS_OPENBSD) |
| 1039 } else if (source_name_ == chrome::kChromeUISandboxHost) { | 1039 } else if (source_name_ == chrome::kChromeUISandboxHost) { |
| 1040 response = AboutSandbox(); | 1040 response = AboutSandbox(); |
| 1041 #endif | 1041 #endif |
| 1042 } else if (source_name_ == chrome::kChromeUIStatsHost) { | 1042 } else if (source_name_ == chrome::kChromeUIStatsHost) { |
| 1043 response = AboutStats(path); | 1043 response = AboutStats(path); |
| 1044 #if !defined(OS_ANDROID) |
| 1044 } else if (source_name_ == chrome::kChromeUITermsHost) { | 1045 } else if (source_name_ == chrome::kChromeUITermsHost) { |
| 1045 #if defined(OS_CHROMEOS) | 1046 #if defined(OS_CHROMEOS) |
| 1046 ChromeOSTermsHandler::Start(path, callback); | 1047 ChromeOSTermsHandler::Start(path, callback); |
| 1047 return; | 1048 return; |
| 1048 #else | 1049 #else |
| 1049 response = l10n_util::GetStringUTF8(IDS_TERMS_HTML); | 1050 response = l10n_util::GetStringUTF8(IDS_TERMS_HTML); |
| 1050 #endif | 1051 #endif |
| 1052 #endif |
| 1051 } | 1053 } |
| 1052 | 1054 |
| 1053 FinishDataRequest(response, callback); | 1055 FinishDataRequest(response, callback); |
| 1054 } | 1056 } |
| 1055 | 1057 |
| 1056 void AboutUIHTMLSource::FinishDataRequest( | 1058 void AboutUIHTMLSource::FinishDataRequest( |
| 1057 const std::string& html, | 1059 const std::string& html, |
| 1058 const content::URLDataSource::GotDataCallback& callback) { | 1060 const content::URLDataSource::GotDataCallback& callback) { |
| 1059 std::string html_copy(html); | 1061 std::string html_copy(html); |
| 1060 callback.Run(base::RefCountedString::TakeString(&html_copy)); | 1062 callback.Run(base::RefCountedString::TakeString(&html_copy)); |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1094 Profile* profile = Profile::FromWebUI(web_ui); | 1096 Profile* profile = Profile::FromWebUI(web_ui); |
| 1095 | 1097 |
| 1096 #if defined(ENABLE_THEMES) | 1098 #if defined(ENABLE_THEMES) |
| 1097 // Set up the chrome://theme/ source. | 1099 // Set up the chrome://theme/ source. |
| 1098 ThemeSource* theme = new ThemeSource(profile); | 1100 ThemeSource* theme = new ThemeSource(profile); |
| 1099 content::URLDataSource::Add(profile, theme); | 1101 content::URLDataSource::Add(profile, theme); |
| 1100 #endif | 1102 #endif |
| 1101 | 1103 |
| 1102 content::URLDataSource::Add(profile, new AboutUIHTMLSource(name, profile)); | 1104 content::URLDataSource::Add(profile, new AboutUIHTMLSource(name, profile)); |
| 1103 } | 1105 } |
| OLD | NEW |