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

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

Issue 2626043007: Clean up chrome://version page. (Closed)
Patch Set: fix rebase Created 3 years, 10 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/app/strings/ios_strings.grd ('k') | no next file » | 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"
11 #include "build/build_config.h" 11 #include "build/build_config.h"
12 #include "components/grit/components_resources.h" 12 #include "components/grit/components_resources.h"
13 #include "components/strings/grit/components_chromium_strings.h" 13 #include "components/strings/grit/components_chromium_strings.h"
14 #include "components/strings/grit/components_google_chrome_strings.h" 14 #include "components/strings/grit/components_google_chrome_strings.h"
15 #include "components/strings/grit/components_strings.h" 15 #include "components/strings/grit/components_strings.h"
16 #include "components/version_info/version_info.h" 16 #include "components/version_info/version_info.h"
17 #include "components/version_ui/version_ui_constants.h" 17 #include "components/version_ui/version_ui_constants.h"
18 #include "ios/chrome/browser/browser_state/chrome_browser_state.h" 18 #include "ios/chrome/browser/browser_state/chrome_browser_state.h"
19 #include "ios/chrome/browser/chrome_url_constants.h" 19 #include "ios/chrome/browser/chrome_url_constants.h"
20 #include "ios/chrome/browser/ui/ui_util.h" 20 #include "ios/chrome/browser/ui/ui_util.h"
21 #include "ios/chrome/browser/ui/webui/version_handler.h" 21 #include "ios/chrome/browser/ui/webui/version_handler.h"
22 #include "ios/chrome/common/channel_info.h" 22 #include "ios/chrome/common/channel_info.h"
23 #include "ios/chrome/grit/ios_chromium_strings.h" 23 #include "ios/chrome/grit/ios_chromium_strings.h"
24 #include "ios/chrome/grit/ios_strings.h"
25 #include "ios/web/public/web_client.h" 24 #include "ios/web/public/web_client.h"
26 #include "ios/web/public/web_ui_ios_data_source.h" 25 #include "ios/web/public/web_ui_ios_data_source.h"
27 #include "ios/web/public/webui/web_ui_ios.h" 26 #include "ios/web/public/webui/web_ui_ios.h"
28 #include "ui/base/l10n/l10n_util.h" 27 #include "ui/base/l10n/l10n_util.h"
29 28
30 #if !defined(__has_feature) || !__has_feature(objc_arc) 29 #if !defined(__has_feature) || !__has_feature(objc_arc)
31 #error "This file requires ARC support." 30 #error "This file requires ARC support."
32 #endif 31 #endif
33 32
34 namespace { 33 namespace {
35 34
36 web::WebUIIOSDataSource* CreateVersionUIDataSource() { 35 web::WebUIIOSDataSource* CreateVersionUIDataSource() {
37 web::WebUIIOSDataSource* html_source = 36 web::WebUIIOSDataSource* html_source =
38 web::WebUIIOSDataSource::Create(kChromeUIVersionHost); 37 web::WebUIIOSDataSource::Create(kChromeUIVersionHost);
39 38
40 // Localized and data strings. 39 // Localized and data strings.
41 html_source->AddLocalizedString(version_ui::kTitle, IDS_VERSION_UI_TITLE); 40 html_source->AddLocalizedString(version_ui::kTitle, IDS_VERSION_UI_TITLE);
42 html_source->AddLocalizedString(version_ui::kApplicationLabel, 41 html_source->AddLocalizedString(version_ui::kApplicationLabel,
43 IDS_IOS_PRODUCT_NAME); 42 IDS_IOS_PRODUCT_NAME);
44 html_source->AddString(version_ui::kVersion, 43 html_source->AddString(version_ui::kVersion,
45 version_info::GetVersionNumber()); 44 version_info::GetVersionNumber());
46 html_source->AddString(version_ui::kVersionModifier, 45 html_source->AddString(version_ui::kVersionModifier,
47 GetChannelString(GetChannel())); 46 GetChannelString(GetChannel()));
48 html_source->AddLocalizedString(version_ui::kOSName, IDS_VERSION_UI_OS); 47 html_source->AddLocalizedString(version_ui::kOSName, IDS_VERSION_UI_OS);
49 html_source->AddLocalizedString(version_ui::kPlatform,
50 IDS_IOS_PLATFORM_LABEL);
51 html_source->AddString(version_ui::kOSType, version_info::GetOSType()); 48 html_source->AddString(version_ui::kOSType, version_info::GetOSType());
52 html_source->AddString(version_ui::kOSVersion, std::string());
53 49
54 html_source->AddLocalizedString(version_ui::kCompany, 50 html_source->AddLocalizedString(version_ui::kCompany,
55 IDS_IOS_ABOUT_VERSION_COMPANY_NAME); 51 IDS_IOS_ABOUT_VERSION_COMPANY_NAME);
56 base::Time::Exploded exploded_time; 52 base::Time::Exploded exploded_time;
57 base::Time::Now().LocalExplode(&exploded_time); 53 base::Time::Now().LocalExplode(&exploded_time);
58 html_source->AddString( 54 html_source->AddString(
59 version_ui::kCopyright, 55 version_ui::kCopyright,
60 l10n_util::GetStringFUTF16(IDS_IOS_ABOUT_VERSION_COPYRIGHT, 56 l10n_util::GetStringFUTF16(IDS_IOS_ABOUT_VERSION_COPYRIGHT,
61 base::IntToString16(exploded_time.year))); 57 base::IntToString16(exploded_time.year)));
62 html_source->AddLocalizedString(version_ui::kRevision, 58 html_source->AddLocalizedString(version_ui::kRevision,
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
108 104
109 } // namespace 105 } // namespace
110 106
111 VersionUI::VersionUI(web::WebUIIOS* web_ui) : web::WebUIIOSController(web_ui) { 107 VersionUI::VersionUI(web::WebUIIOS* web_ui) : web::WebUIIOSController(web_ui) {
112 web_ui->AddMessageHandler(base::MakeUnique<VersionHandler>()); 108 web_ui->AddMessageHandler(base::MakeUnique<VersionHandler>());
113 web::WebUIIOSDataSource::Add(ios::ChromeBrowserState::FromWebUIIOS(web_ui), 109 web::WebUIIOSDataSource::Add(ios::ChromeBrowserState::FromWebUIIOS(web_ui),
114 CreateVersionUIDataSource()); 110 CreateVersionUIDataSource());
115 } 111 }
116 112
117 VersionUI::~VersionUI() {} 113 VersionUI::~VersionUI() {}
OLDNEW
« no previous file with comments | « ios/chrome/app/strings/ios_strings.grd ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698