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

Side by Side Diff: ios/chrome/browser/ui/webui/version_ui.mm

Issue 2705293014: Created web::UserAgentType. (Closed)
Patch Set: rebase + compile fix Created 3 years, 9 months 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
« no previous file with comments | « ios/chrome/browser/tabs/tab.mm ('k') | ios/chrome/browser/ui/webui/web_ui_egtest.mm » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 "ios/chrome/browser/ui/webui/version_ui.h" 5 #include "ios/chrome/browser/ui/webui/version_ui.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/memory/ptr_util.h" 8 #include "base/memory/ptr_util.h"
9 #include "base/strings/string_number_conversions.h" 9 #include "base/strings/string_number_conversions.h"
10 #include "base/strings/stringprintf.h" 10 #include "base/strings/stringprintf.h"
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
70 : IDS_VERSION_UI_UNOFFICIAL); 70 : IDS_VERSION_UI_UNOFFICIAL);
71 #if defined(ARCH_CPU_64_BITS) 71 #if defined(ARCH_CPU_64_BITS)
72 html_source->AddLocalizedString(version_ui::kVersionBitSize, 72 html_source->AddLocalizedString(version_ui::kVersionBitSize,
73 IDS_VERSION_UI_64BIT); 73 IDS_VERSION_UI_64BIT);
74 #else 74 #else
75 html_source->AddLocalizedString(version_ui::kVersionBitSize, 75 html_source->AddLocalizedString(version_ui::kVersionBitSize,
76 IDS_VERSION_UI_32BIT); 76 IDS_VERSION_UI_32BIT);
77 #endif 77 #endif
78 html_source->AddLocalizedString(version_ui::kUserAgentName, 78 html_source->AddLocalizedString(version_ui::kUserAgentName,
79 IDS_VERSION_UI_USER_AGENT); 79 IDS_VERSION_UI_USER_AGENT);
80 html_source->AddString(version_ui::kUserAgent, 80 html_source->AddString(
81 web::GetWebClient()->GetUserAgent(false)); 81 version_ui::kUserAgent,
82 web::GetWebClient()->GetUserAgent(web::UserAgentType::MOBILE));
82 html_source->AddLocalizedString(version_ui::kCommandLineName, 83 html_source->AddLocalizedString(version_ui::kCommandLineName,
83 IDS_VERSION_UI_COMMAND_LINE); 84 IDS_VERSION_UI_COMMAND_LINE);
84 85
85 std::string command_line; 86 std::string command_line;
86 typedef std::vector<std::string> ArgvList; 87 typedef std::vector<std::string> ArgvList;
87 const ArgvList& argv = base::CommandLine::ForCurrentProcess()->argv(); 88 const ArgvList& argv = base::CommandLine::ForCurrentProcess()->argv();
88 for (ArgvList::const_iterator iter = argv.begin(); iter != argv.end(); iter++) 89 for (ArgvList::const_iterator iter = argv.begin(); iter != argv.end(); iter++)
89 command_line += " " + *iter; 90 command_line += " " + *iter;
90 // TODO(viettrungluu): |command_line| could really have any encoding, whereas 91 // TODO(viettrungluu): |command_line| could really have any encoding, whereas
91 // below we assumes it's UTF-8. 92 // below we assumes it's UTF-8.
(...skipping 12 matching lines...) Expand all
104 105
105 } // namespace 106 } // namespace
106 107
107 VersionUI::VersionUI(web::WebUIIOS* web_ui) : web::WebUIIOSController(web_ui) { 108 VersionUI::VersionUI(web::WebUIIOS* web_ui) : web::WebUIIOSController(web_ui) {
108 web_ui->AddMessageHandler(base::MakeUnique<VersionHandler>()); 109 web_ui->AddMessageHandler(base::MakeUnique<VersionHandler>());
109 web::WebUIIOSDataSource::Add(ios::ChromeBrowserState::FromWebUIIOS(web_ui), 110 web::WebUIIOSDataSource::Add(ios::ChromeBrowserState::FromWebUIIOS(web_ui),
110 CreateVersionUIDataSource()); 111 CreateVersionUIDataSource());
111 } 112 }
112 113
113 VersionUI::~VersionUI() {} 114 VersionUI::~VersionUI() {}
OLDNEW
« no previous file with comments | « ios/chrome/browser/tabs/tab.mm ('k') | ios/chrome/browser/ui/webui/web_ui_egtest.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698