OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/options/chromeos/about_page_handler.h" | 5 #include "chrome/browser/ui/webui/options/chromeos/about_page_handler.h" |
6 | 6 |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
11 #include "base/bind_helpers.h" | 11 #include "base/bind_helpers.h" |
12 #include "base/command_line.h" | 12 #include "base/command_line.h" |
13 #include "base/i18n/time_formatting.h" | 13 #include "base/i18n/time_formatting.h" |
14 #include "base/string16.h" | 14 #include "base/string16.h" |
15 #include "base/string_number_conversions.h" | 15 #include "base/string_number_conversions.h" |
16 #include "base/time.h" | 16 #include "base/time.h" |
17 #include "base/utf_string_conversions.h" | 17 #include "base/utf_string_conversions.h" |
18 #include "base/values.h" | 18 #include "base/values.h" |
19 #include "chrome/browser/chromeos/cros/cros_library.h" | 19 #include "chrome/browser/chromeos/cros/cros_library.h" |
20 #include "chrome/browser/chromeos/cros/power_library.h" | 20 #include "chrome/browser/chromeos/cros/power_library.h" |
21 #include "chrome/browser/chromeos/cros/update_library.h" | 21 #include "chrome/browser/chromeos/cros/update_library.h" |
22 #include "chrome/browser/chromeos/login/user_manager.h" | 22 #include "chrome/browser/chromeos/login/user_manager.h" |
23 #include "chrome/browser/chromeos/login/wizard_controller.h" | 23 #include "chrome/browser/chromeos/login/wizard_controller.h" |
24 #include "chrome/browser/chromeos/user_cros_settings_provider.h" | 24 #include "chrome/browser/chromeos/user_cros_settings_provider.h" |
25 #include "chrome/browser/google/google_util.h" | 25 #include "chrome/browser/google/google_util.h" |
26 #include "chrome/common/chrome_version_info.h" | 26 #include "chrome/common/chrome_version_info.h" |
27 #include "chrome/common/url_constants.h" | 27 #include "chrome/common/url_constants.h" |
| 28 #include "content/common/content_client.h" |
28 #include "googleurl/src/gurl.h" | 29 #include "googleurl/src/gurl.h" |
29 #include "grit/chromium_strings.h" | 30 #include "grit/chromium_strings.h" |
30 #include "grit/generated_resources.h" | 31 #include "grit/generated_resources.h" |
31 #include "grit/locale_settings.h" | 32 #include "grit/locale_settings.h" |
32 #include "grit/theme_resources.h" | 33 #include "grit/theme_resources.h" |
33 #include "ui/base/l10n/l10n_util.h" | 34 #include "ui/base/l10n/l10n_util.h" |
34 #include "ui/base/resource/resource_bundle.h" | 35 #include "ui/base/resource/resource_bundle.h" |
35 #include "v8/include/v8.h" | 36 #include "v8/include/v8.h" |
36 #include "webkit/glue/user_agent.h" | |
37 #include "webkit/glue/webkit_glue.h" | 37 #include "webkit/glue/webkit_glue.h" |
38 | 38 |
39 namespace { | 39 namespace { |
40 | 40 |
41 // These are used as placeholder text around the links in the text in the | 41 // These are used as placeholder text around the links in the text in the |
42 // license. | 42 // license. |
43 const char kBeginLink[] = "BEGIN_LINK"; | 43 const char kBeginLink[] = "BEGIN_LINK"; |
44 const char kEndLink[] = "END_LINK"; | 44 const char kEndLink[] = "END_LINK"; |
45 const char kBeginLinkChr[] = "BEGIN_LINK_CHR"; | 45 const char kBeginLinkChr[] = "BEGIN_LINK_CHR"; |
46 const char kBeginLinkOss[] = "BEGIN_LINK_OSS"; | 46 const char kBeginLinkOss[] = "BEGIN_LINK_OSS"; |
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
207 webkit_glue::GetWebKitVersion()); | 207 webkit_glue::GetWebKitVersion()); |
208 | 208 |
209 // javascript | 209 // javascript |
210 | 210 |
211 localized_strings->SetString("js_engine", "V8"); | 211 localized_strings->SetString("js_engine", "V8"); |
212 localized_strings->SetString("js_engine_version", v8::V8::GetVersion()); | 212 localized_strings->SetString("js_engine_version", v8::V8::GetVersion()); |
213 | 213 |
214 // user agent | 214 // user agent |
215 | 215 |
216 localized_strings->SetString("user_agent_info", | 216 localized_strings->SetString("user_agent_info", |
217 webkit_glue::GetUserAgent(GURL())); | 217 content::GetUserAgent(GURL())); |
218 | 218 |
219 // command line | 219 // command line |
220 | 220 |
221 #if defined(OS_WIN) | 221 #if defined(OS_WIN) |
222 localized_strings->SetString("command_line_info", | 222 localized_strings->SetString("command_line_info", |
223 WideToUTF16(CommandLine::ForCurrentProcess()->GetCommandLineString())); | 223 WideToUTF16(CommandLine::ForCurrentProcess()->GetCommandLineString())); |
224 #elif defined(OS_POSIX) | 224 #elif defined(OS_POSIX) |
225 // TODO(viettrungluu): something horrible might happen if there are non-UTF-8 | 225 // TODO(viettrungluu): something horrible might happen if there are non-UTF-8 |
226 // arguments (since |SetString()| requires Unicode). | 226 // arguments (since |SetString()| requires Unicode). |
227 std::string command_line = ""; | 227 std::string command_line = ""; |
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
414 if (CrosLibrary::Get()->GetUpdateLibrary()->HasObserver(observer)) { | 414 if (CrosLibrary::Get()->GetUpdateLibrary()->HasObserver(observer)) { |
415 // If UpdateLibrary still has the observer, then the page handler is valid. | 415 // If UpdateLibrary still has the observer, then the page handler is valid. |
416 AboutPageHandler* handler = observer->page_handler(); | 416 AboutPageHandler* handler = observer->page_handler(); |
417 scoped_ptr<Value> channel_string(Value::CreateStringValue(channel)); | 417 scoped_ptr<Value> channel_string(Value::CreateStringValue(channel)); |
418 handler->web_ui_->CallJavascriptFunction( | 418 handler->web_ui_->CallJavascriptFunction( |
419 "AboutPage.updateSelectedOptionCallback", *channel_string); | 419 "AboutPage.updateSelectedOptionCallback", *channel_string); |
420 } | 420 } |
421 } | 421 } |
422 | 422 |
423 } // namespace chromeos | 423 } // namespace chromeos |
OLD | NEW |