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