| 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/file_util.h" | 8 #include "base/file_util.h" |
| 9 #include "base/utf_string_conversions.h" | 9 #include "base/utf_string_conversions.h" |
| 10 #include "chrome/browser/profiles/profile.h" | 10 #include "chrome/browser/profiles/profile.h" |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 85 html_source->AddLocalizedString("user_agent_name", | 85 html_source->AddLocalizedString("user_agent_name", |
| 86 IDS_ABOUT_VERSION_USER_AGENT); | 86 IDS_ABOUT_VERSION_USER_AGENT); |
| 87 html_source->AddString("useragent", content::GetUserAgent(GURL())); | 87 html_source->AddString("useragent", content::GetUserAgent(GURL())); |
| 88 html_source->AddLocalizedString("command_line_name", | 88 html_source->AddLocalizedString("command_line_name", |
| 89 IDS_ABOUT_VERSION_COMMAND_LINE); | 89 IDS_ABOUT_VERSION_COMMAND_LINE); |
| 90 | 90 |
| 91 #if defined(OS_WIN) | 91 #if defined(OS_WIN) |
| 92 html_source->AddString("command_line", | 92 html_source->AddString("command_line", |
| 93 WideToUTF16(CommandLine::ForCurrentProcess()->GetCommandLineString())); | 93 WideToUTF16(CommandLine::ForCurrentProcess()->GetCommandLineString())); |
| 94 #elif defined(OS_POSIX) | 94 #elif defined(OS_POSIX) |
| 95 std::string command_line = ""; | 95 std::string command_line; |
| 96 typedef std::vector<std::string> ArgvList; | 96 typedef std::vector<std::string> ArgvList; |
| 97 const ArgvList& argv = CommandLine::ForCurrentProcess()->argv(); | 97 const ArgvList& argv = CommandLine::ForCurrentProcess()->argv(); |
| 98 for (ArgvList::const_iterator iter = argv.begin(); iter != argv.end(); iter++) | 98 for (ArgvList::const_iterator iter = argv.begin(); iter != argv.end(); iter++) |
| 99 command_line += " " + *iter; | 99 command_line += " " + *iter; |
| 100 // TODO(viettrungluu): |command_line| could really have any encoding, whereas | 100 // TODO(viettrungluu): |command_line| could really have any encoding, whereas |
| 101 // below we assumes it's UTF-8. | 101 // below we assumes it's UTF-8. |
| 102 html_source->AddString("command_line", command_line); | 102 html_source->AddString("command_line", command_line); |
| 103 #endif | 103 #endif |
| 104 | 104 |
| 105 // Note that the executable path and profile path are retrieved asynchronously | 105 // Note that the executable path and profile path are retrieved asynchronously |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 140 // Set up the chrome://theme/ source. | 140 // Set up the chrome://theme/ source. |
| 141 ThemeSource* theme = new ThemeSource(profile); | 141 ThemeSource* theme = new ThemeSource(profile); |
| 142 content::URLDataSource::Add(profile, theme); | 142 content::URLDataSource::Add(profile, theme); |
| 143 #endif | 143 #endif |
| 144 | 144 |
| 145 content::WebUIDataSource::Add(profile, CreateVersionUIDataSource(profile)); | 145 content::WebUIDataSource::Add(profile, CreateVersionUIDataSource(profile)); |
| 146 } | 146 } |
| 147 | 147 |
| 148 VersionUI::~VersionUI() { | 148 VersionUI::~VersionUI() { |
| 149 } | 149 } |
| OLD | NEW |