Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(589)

Side by Side Diff: chrome/browser/ui/webui/version_ui.cc

Issue 816403003: Make callers of CommandLine use it via the base:: namespace. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/webui/version_handler.cc ('k') | chrome/browser/ui/window_sizer/window_sizer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698