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

Side by Side Diff: chrome/browser/ui/webui/help/help_handler.cc

Issue 1905113002: Add ARC version to help and version pages (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: nits Created 4 years, 8 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
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/help/help_handler.h" 5 #include "chrome/browser/ui/webui/help/help_handler.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <string> 9 #include <string>
10 10
(...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after
246 {"updatingChannelSwitch", IDS_UPGRADE_UPDATING_CHANNEL_SWITCH}, 246 {"updatingChannelSwitch", IDS_UPGRADE_UPDATING_CHANNEL_SWITCH},
247 #endif 247 #endif
248 {"updateAlmostDone", IDS_UPGRADE_SUCCESSFUL_RELAUNCH}, 248 {"updateAlmostDone", IDS_UPGRADE_SUCCESSFUL_RELAUNCH},
249 #if defined(OS_CHROMEOS) 249 #if defined(OS_CHROMEOS)
250 {"successfulChannelSwitch", IDS_UPGRADE_SUCCESSFUL_CHANNEL_SWITCH}, 250 {"successfulChannelSwitch", IDS_UPGRADE_SUCCESSFUL_CHANNEL_SWITCH},
251 #endif 251 #endif
252 {"getHelpWithChrome", IDS_GET_HELP_USING_CHROME}, 252 {"getHelpWithChrome", IDS_GET_HELP_USING_CHROME},
253 {"reportAnIssue", IDS_REPORT_AN_ISSUE}, 253 {"reportAnIssue", IDS_REPORT_AN_ISSUE},
254 #if defined(OS_CHROMEOS) 254 #if defined(OS_CHROMEOS)
255 {"platform", IDS_PLATFORM_LABEL}, 255 {"platform", IDS_PLATFORM_LABEL},
256 {"arcVersion", IDS_ARC_VERSION_LABEL},
256 {"firmware", IDS_ABOUT_PAGE_FIRMWARE}, 257 {"firmware", IDS_ABOUT_PAGE_FIRMWARE},
257 {"showMoreInfo", IDS_SHOW_MORE_INFO}, 258 {"showMoreInfo", IDS_SHOW_MORE_INFO},
258 {"hideMoreInfo", IDS_HIDE_MORE_INFO}, 259 {"hideMoreInfo", IDS_HIDE_MORE_INFO},
259 {"channel", IDS_ABOUT_PAGE_CHANNEL}, 260 {"channel", IDS_ABOUT_PAGE_CHANNEL},
260 {"stable", IDS_ABOUT_PAGE_CHANNEL_STABLE}, 261 {"stable", IDS_ABOUT_PAGE_CHANNEL_STABLE},
261 {"beta", IDS_ABOUT_PAGE_CHANNEL_BETA}, 262 {"beta", IDS_ABOUT_PAGE_CHANNEL_BETA},
262 {"dev", IDS_ABOUT_PAGE_CHANNEL_DEVELOPMENT}, 263 {"dev", IDS_ABOUT_PAGE_CHANNEL_DEVELOPMENT},
263 {"channel-changed", IDS_ABOUT_PAGE_CHANNEL_CHANGED}, 264 {"channel-changed", IDS_ABOUT_PAGE_CHANNEL_CHANGED},
264 {"currentChannelStable", IDS_ABOUT_PAGE_CURRENT_CHANNEL_STABLE}, 265 {"currentChannelStable", IDS_ABOUT_PAGE_CURRENT_CHANNEL_STABLE},
265 {"currentChannelBeta", IDS_ABOUT_PAGE_CURRENT_CHANNEL_BETA}, 266 {"currentChannelBeta", IDS_ABOUT_PAGE_CURRENT_CHANNEL_BETA},
(...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after
469 base::PostTaskAndReplyWithResult( 470 base::PostTaskAndReplyWithResult(
470 content::BrowserThread::GetBlockingPool(), 471 content::BrowserThread::GetBlockingPool(),
471 FROM_HERE, 472 FROM_HERE,
472 base::Bind(&chromeos::version_loader::GetVersion, 473 base::Bind(&chromeos::version_loader::GetVersion,
473 chromeos::version_loader::VERSION_FULL), 474 chromeos::version_loader::VERSION_FULL),
474 base::Bind(&HelpHandler::OnOSVersion, 475 base::Bind(&HelpHandler::OnOSVersion,
475 weak_factory_.GetWeakPtr())); 476 weak_factory_.GetWeakPtr()));
476 base::PostTaskAndReplyWithResult( 477 base::PostTaskAndReplyWithResult(
477 content::BrowserThread::GetBlockingPool(), 478 content::BrowserThread::GetBlockingPool(),
478 FROM_HERE, 479 FROM_HERE,
480 base::Bind(&chromeos::version_loader::GetARCVersion),
481 base::Bind(&HelpHandler::OnARCVersion,
482 weak_factory_.GetWeakPtr()));
483 base::PostTaskAndReplyWithResult(
484 content::BrowserThread::GetBlockingPool(),
485 FROM_HERE,
479 base::Bind(&chromeos::version_loader::GetFirmware), 486 base::Bind(&chromeos::version_loader::GetFirmware),
480 base::Bind(&HelpHandler::OnOSFirmware, 487 base::Bind(&HelpHandler::OnOSFirmware,
481 weak_factory_.GetWeakPtr())); 488 weak_factory_.GetWeakPtr()));
482 489
483 web_ui()->CallJavascriptFunction( 490 web_ui()->CallJavascriptFunction(
484 "help.HelpPage.updateEnableReleaseChannel", 491 "help.HelpPage.updateEnableReleaseChannel",
485 base::FundamentalValue(CanChangeChannel(Profile::FromWebUI(web_ui())))); 492 base::FundamentalValue(CanChangeChannel(Profile::FromWebUI(web_ui()))));
486 493
487 base::Time build_time = base::SysInfo::GetLsbReleaseTime(); 494 base::Time build_time = base::SysInfo::GetLsbReleaseTime();
488 base::string16 build_date = base::TimeFormatFriendlyDate(build_time); 495 base::string16 build_date = base::TimeFormatFriendlyDate(build_time);
(...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after
683 base::StringValue(state_str)); 690 base::StringValue(state_str));
684 } 691 }
685 #endif // defined(OS_MACOSX) 692 #endif // defined(OS_MACOSX)
686 693
687 #if defined(OS_CHROMEOS) 694 #if defined(OS_CHROMEOS)
688 void HelpHandler::OnOSVersion(const std::string& version) { 695 void HelpHandler::OnOSVersion(const std::string& version) {
689 web_ui()->CallJavascriptFunction("help.HelpPage.setOSVersion", 696 web_ui()->CallJavascriptFunction("help.HelpPage.setOSVersion",
690 base::StringValue(version)); 697 base::StringValue(version));
691 } 698 }
692 699
700 void HelpHandler::OnARCVersion(const std::string& firmware) {
701 web_ui()->CallJavascriptFunction("help.HelpPage.setARCVersion",
702 base::StringValue(firmware));
703 }
704
693 void HelpHandler::OnOSFirmware(const std::string& firmware) { 705 void HelpHandler::OnOSFirmware(const std::string& firmware) {
694 web_ui()->CallJavascriptFunction("help.HelpPage.setOSFirmware", 706 web_ui()->CallJavascriptFunction("help.HelpPage.setOSFirmware",
695 base::StringValue(firmware)); 707 base::StringValue(firmware));
696 } 708 }
697 709
698 void HelpHandler::OnCurrentChannel(const std::string& channel) { 710 void HelpHandler::OnCurrentChannel(const std::string& channel) {
699 web_ui()->CallJavascriptFunction( 711 web_ui()->CallJavascriptFunction(
700 "help.HelpPage.updateCurrentChannel", base::StringValue(channel)); 712 "help.HelpPage.updateCurrentChannel", base::StringValue(channel));
701 } 713 }
702 714
(...skipping 24 matching lines...) Expand all
727 } 739 }
728 740
729 void HelpHandler::OnRegulatoryLabelTextRead(const std::string& text) { 741 void HelpHandler::OnRegulatoryLabelTextRead(const std::string& text) {
730 // Remove unnecessary whitespace. 742 // Remove unnecessary whitespace.
731 web_ui()->CallJavascriptFunction( 743 web_ui()->CallJavascriptFunction(
732 "help.HelpPage.setRegulatoryLabelText", 744 "help.HelpPage.setRegulatoryLabelText",
733 base::StringValue(base::CollapseWhitespaceASCII(text, true))); 745 base::StringValue(base::CollapseWhitespaceASCII(text, true)));
734 } 746 }
735 747
736 #endif // defined(OS_CHROMEOS) 748 #endif // defined(OS_CHROMEOS)
OLDNEW
« no previous file with comments | « chrome/browser/ui/webui/help/help_handler.h ('k') | chrome/browser/ui/webui/version_handler_chromeos.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698