| 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/callback.h" | 10 #include "base/callback.h" |
| 11 #include "base/command_line.h" | 11 #include "base/command_line.h" |
| 12 #include "base/i18n/time_formatting.h" | 12 #include "base/i18n/time_formatting.h" |
| 13 #include "base/string16.h" | 13 #include "base/string16.h" |
| 14 #include "base/string_number_conversions.h" | 14 #include "base/string_number_conversions.h" |
| 15 #include "base/time.h" | 15 #include "base/time.h" |
| 16 #include "base/utf_string_conversions.h" | 16 #include "base/utf_string_conversions.h" |
| 17 #include "base/values.h" | 17 #include "base/values.h" |
| 18 #include "chrome/browser/google/google_util.h" | 18 #include "chrome/browser/google/google_util.h" |
| 19 #include "chrome/common/chrome_version_info.h" | 19 #include "chrome/common/chrome_version_info.h" |
| 20 #include "chrome/common/url_constants.h" | 20 #include "chrome/common/url_constants.h" |
| 21 #include "googleurl/src/gurl.h" | 21 #include "googleurl/src/gurl.h" |
| 22 #include "grit/chromium_strings.h" | 22 #include "grit/chromium_strings.h" |
| 23 #include "grit/generated_resources.h" | 23 #include "grit/generated_resources.h" |
| 24 #include "grit/locale_settings.h" | 24 #include "grit/locale_settings.h" |
| 25 #include "grit/theme_resources.h" | 25 #include "grit/theme_resources.h" |
| 26 #include "ui/base/l10n/l10n_util.h" | 26 #include "ui/base/l10n/l10n_util.h" |
| 27 #include "ui/base/resource/resource_bundle.h" | 27 #include "ui/base/resource/resource_bundle.h" |
| 28 #include "v8/include/v8.h" |
| 28 #include "webkit/glue/webkit_glue.h" | 29 #include "webkit/glue/webkit_glue.h" |
| 29 | 30 |
| 30 #if defined(CHROME_V8) | |
| 31 #include "v8/include/v8.h" | |
| 32 #endif | |
| 33 | |
| 34 #include "chrome/browser/chromeos/cros/cros_library.h" | 31 #include "chrome/browser/chromeos/cros/cros_library.h" |
| 35 #include "chrome/browser/chromeos/cros/power_library.h" | 32 #include "chrome/browser/chromeos/cros/power_library.h" |
| 36 #include "chrome/browser/chromeos/cros/update_library.h" | 33 #include "chrome/browser/chromeos/cros/update_library.h" |
| 37 #include "chrome/browser/chromeos/login/user_manager.h" | 34 #include "chrome/browser/chromeos/login/user_manager.h" |
| 38 #include "chrome/browser/chromeos/login/wizard_controller.h" | 35 #include "chrome/browser/chromeos/login/wizard_controller.h" |
| 39 #include "chrome/browser/chromeos/user_cros_settings_provider.h" | 36 #include "chrome/browser/chromeos/user_cros_settings_provider.h" |
| 40 | 37 |
| 41 namespace { | 38 namespace { |
| 42 | 39 |
| 43 // These are used as placeholder text around the links in the text in the | 40 // These are used as placeholder text around the links in the text in the |
| (...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 203 localized_strings->SetString("cros_license_link_0", | 200 localized_strings->SetString("cros_license_link_0", |
| 204 chrome::kChromeUIOSCreditsURL); | 201 chrome::kChromeUIOSCreditsURL); |
| 205 | 202 |
| 206 // webkit | 203 // webkit |
| 207 | 204 |
| 208 localized_strings->SetString("webkit_version", | 205 localized_strings->SetString("webkit_version", |
| 209 webkit_glue::GetWebKitVersion()); | 206 webkit_glue::GetWebKitVersion()); |
| 210 | 207 |
| 211 // javascript | 208 // javascript |
| 212 | 209 |
| 213 #if defined(CHROME_V8) | |
| 214 localized_strings->SetString("js_engine", "V8"); | 210 localized_strings->SetString("js_engine", "V8"); |
| 215 localized_strings->SetString("js_engine_version", v8::V8::GetVersion()); | 211 localized_strings->SetString("js_engine_version", v8::V8::GetVersion()); |
| 216 #else | |
| 217 localized_strings->SetString("js_engine", "JavaScriptCore"); | |
| 218 localized_strings->SetString("js_engine_version", | |
| 219 webkit_glue::GetWebKitVersion()); | |
| 220 #endif | |
| 221 | 212 |
| 222 // user agent | 213 // user agent |
| 223 | 214 |
| 224 localized_strings->SetString("user_agent_info", | 215 localized_strings->SetString("user_agent_info", |
| 225 webkit_glue::GetUserAgent(GURL())); | 216 webkit_glue::GetUserAgent(GURL())); |
| 226 | 217 |
| 227 // command line | 218 // command line |
| 228 | 219 |
| 229 #if defined(OS_WIN) | 220 #if defined(OS_WIN) |
| 230 localized_strings->SetString("command_line_info", | 221 localized_strings->SetString("command_line_info", |
| (...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 421 if (CrosLibrary::Get()->GetUpdateLibrary()->HasObserver(observer)) { | 412 if (CrosLibrary::Get()->GetUpdateLibrary()->HasObserver(observer)) { |
| 422 // If UpdateLibrary still has the observer, then the page handler is valid. | 413 // If UpdateLibrary still has the observer, then the page handler is valid. |
| 423 AboutPageHandler* handler = observer->page_handler(); | 414 AboutPageHandler* handler = observer->page_handler(); |
| 424 scoped_ptr<Value> channel_string(Value::CreateStringValue(channel)); | 415 scoped_ptr<Value> channel_string(Value::CreateStringValue(channel)); |
| 425 handler->web_ui_->CallJavascriptFunction( | 416 handler->web_ui_->CallJavascriptFunction( |
| 426 "AboutPage.updateSelectedOptionCallback", *channel_string); | 417 "AboutPage.updateSelectedOptionCallback", *channel_string); |
| 427 } | 418 } |
| 428 } | 419 } |
| 429 | 420 |
| 430 } // namespace chromeos | 421 } // namespace chromeos |
| OLD | NEW |