| 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/version_ui.h" | 5 #include "chrome/browser/ui/webui/version_ui.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/strings/string_number_conversions.h" | 8 #include "base/strings/string_number_conversions.h" |
| 9 #include "base/strings/utf_string_conversions.h" | |
| 10 #include "chrome/browser/profiles/profile.h" | 9 #include "chrome/browser/profiles/profile.h" |
| 11 #include "chrome/browser/ui/webui/version_handler.h" | 10 #include "chrome/browser/ui/webui/version_handler.h" |
| 12 #include "chrome/common/chrome_content_client.h" | 11 #include "chrome/common/chrome_content_client.h" |
| 13 #include "chrome/common/chrome_version_info.h" | 12 #include "chrome/common/chrome_version_info.h" |
| 14 #include "chrome/common/url_constants.h" | 13 #include "chrome/common/url_constants.h" |
| 15 #include "chrome/grit/chromium_strings.h" | 14 #include "chrome/grit/chromium_strings.h" |
| 16 #include "chrome/grit/generated_resources.h" | 15 #include "chrome/grit/generated_resources.h" |
| 17 #include "chrome/grit/google_chrome_strings.h" | 16 #include "chrome/grit/google_chrome_strings.h" |
| 18 #include "content/public/browser/url_data_source.h" | 17 #include "content/public/browser/url_data_source.h" |
| 19 #include "content/public/browser/web_ui.h" | 18 #include "content/public/browser/web_ui.h" |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 90 #endif | 89 #endif |
| 91 html_source->AddLocalizedString("user_agent_name", | 90 html_source->AddLocalizedString("user_agent_name", |
| 92 IDS_ABOUT_VERSION_USER_AGENT); | 91 IDS_ABOUT_VERSION_USER_AGENT); |
| 93 html_source->AddString("useragent", GetUserAgent()); | 92 html_source->AddString("useragent", GetUserAgent()); |
| 94 html_source->AddLocalizedString("command_line_name", | 93 html_source->AddLocalizedString("command_line_name", |
| 95 IDS_ABOUT_VERSION_COMMAND_LINE); | 94 IDS_ABOUT_VERSION_COMMAND_LINE); |
| 96 | 95 |
| 97 #if defined(OS_WIN) | 96 #if defined(OS_WIN) |
| 98 html_source->AddString( | 97 html_source->AddString( |
| 99 "command_line", | 98 "command_line", |
| 100 base::WideToUTF16( | 99 base::CommandLine::ForCurrentProcess()->GetCommandLineString()); |
| 101 base::CommandLine::ForCurrentProcess()->GetCommandLineString())); | |
| 102 #elif defined(OS_POSIX) | 100 #elif defined(OS_POSIX) |
| 103 std::string command_line; | 101 std::string command_line; |
| 104 typedef std::vector<std::string> ArgvList; | 102 typedef std::vector<std::string> ArgvList; |
| 105 const ArgvList& argv = base::CommandLine::ForCurrentProcess()->argv(); | 103 const ArgvList& argv = base::CommandLine::ForCurrentProcess()->argv(); |
| 106 for (ArgvList::const_iterator iter = argv.begin(); iter != argv.end(); iter++) | 104 for (ArgvList::const_iterator iter = argv.begin(); iter != argv.end(); iter++) |
| 107 command_line += " " + *iter; | 105 command_line += " " + *iter; |
| 108 // TODO(viettrungluu): |command_line| could really have any encoding, whereas | 106 // TODO(viettrungluu): |command_line| could really have any encoding, whereas |
| 109 // below we assumes it's UTF-8. | 107 // below we assumes it's UTF-8. |
| 110 html_source->AddString("command_line", command_line); | 108 html_source->AddString("command_line", command_line); |
| 111 #endif | 109 #endif |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 147 // Set up the chrome://theme/ source. | 145 // Set up the chrome://theme/ source. |
| 148 ThemeSource* theme = new ThemeSource(profile); | 146 ThemeSource* theme = new ThemeSource(profile); |
| 149 content::URLDataSource::Add(profile, theme); | 147 content::URLDataSource::Add(profile, theme); |
| 150 #endif | 148 #endif |
| 151 | 149 |
| 152 WebUIDataSource::Add(profile, CreateVersionUIDataSource()); | 150 WebUIDataSource::Add(profile, CreateVersionUIDataSource()); |
| 153 } | 151 } |
| 154 | 152 |
| 155 VersionUI::~VersionUI() { | 153 VersionUI::~VersionUI() { |
| 156 } | 154 } |
| OLD | NEW |