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/help/help_handler.h" | 5 #include "chrome/browser/ui/webui/help/help_handler.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
82 // connect to a network of one of the allowed types. | 82 // connect to a network of one of the allowed types. |
83 string16 GetAllowedConnectionTypesMessage() { | 83 string16 GetAllowedConnectionTypesMessage() { |
84 if (help_utils_chromeos::IsUpdateOverCellularAllowed()) { | 84 if (help_utils_chromeos::IsUpdateOverCellularAllowed()) { |
85 return l10n_util::GetStringUTF16(IDS_UPGRADE_NETWORK_LIST_CELLULAR_ALLOWED); | 85 return l10n_util::GetStringUTF16(IDS_UPGRADE_NETWORK_LIST_CELLULAR_ALLOWED); |
86 } else { | 86 } else { |
87 return l10n_util::GetStringUTF16( | 87 return l10n_util::GetStringUTF16( |
88 IDS_UPGRADE_NETWORK_LIST_CELLULAR_DISALLOWED); | 88 IDS_UPGRADE_NETWORK_LIST_CELLULAR_DISALLOWED); |
89 } | 89 } |
90 } | 90 } |
91 | 91 |
92 bool CanChangeReleaseChannel() { | 92 // Returns true if the device is enterprise managed, false otherwise. |
93 // On non managed machines we have local owner who is the only one to change | 93 bool IsEnterpriseManaged() { |
94 // anything. | 94 return g_browser_process->browser_policy_connector()->IsEnterpriseManaged(); |
95 if (chromeos::UserManager::Get()->IsCurrentUserOwner()) | 95 } |
96 return true; | 96 |
97 // Returns true if current user can change channel, false otherwise. | |
98 bool CanChangeChannel() { | |
99 bool value = false; | |
100 chromeos::CrosSettings::Get()->GetBoolean(chromeos::kReleaseChannelDelegated, | |
101 &value); | |
102 | |
97 // On a managed machine we delegate this setting to the users of the same | 103 // On a managed machine we delegate this setting to the users of the same |
98 // domain only if the policy value is "domain". | 104 // domain only if the policy value is "domain". |
99 if (g_browser_process->browser_policy_connector()->IsEnterpriseManaged()) { | 105 if (IsEnterpriseManaged()) { |
100 bool value = false; | 106 if (!value) |
101 if (!chromeos::CrosSettings::Get()->GetBoolean( | |
102 chromeos::kReleaseChannelDelegated, &value) || !value) | |
103 return false; | 107 return false; |
104 // Get the currently logged in user and strip the domain part only. | 108 // Get the currently logged in user and strip the domain part only. |
105 std::string domain = ""; | 109 std::string domain = ""; |
106 std::string user = chromeos::UserManager::Get()->GetLoggedInUser()->email(); | 110 std::string user = chromeos::UserManager::Get()->GetLoggedInUser()->email(); |
107 size_t at_pos = user.find('@'); | 111 size_t at_pos = user.find('@'); |
108 if (at_pos != std::string::npos && at_pos + 1 < user.length()) | 112 if (at_pos != std::string::npos && at_pos + 1 < user.length()) |
109 domain = user.substr(user.find('@') + 1); | 113 domain = user.substr(user.find('@') + 1); |
110 return domain == g_browser_process->browser_policy_connector()-> | 114 return domain == g_browser_process->browser_policy_connector()-> |
111 GetEnterpriseDomain(); | 115 GetEnterpriseDomain(); |
116 } else if (chromeos::UserManager::Get()->IsCurrentUserOwner()) { | |
117 // On non managed machines we have local owner who is the only one to change | |
118 // anything. Ensure that ReleaseChannelDelegated is false. | |
119 return !value; | |
112 } | 120 } |
113 return false; | 121 return false; |
114 } | 122 } |
115 | 123 |
116 // Pointer to a |StringValue| holding the date of the build date to Chromium | 124 // Pointer to a |StringValue| holding the date of the build date to Chromium |
117 // OS. Because this value is obtained by reading a file, it is cached here to | 125 // OS. Because this value is obtained by reading a file, it is cached here to |
118 // prevent the need to read from the file system multiple times unnecessarily. | 126 // prevent the need to read from the file system multiple times unnecessarily. |
119 Value* g_build_date_string = NULL; | 127 Value* g_build_date_string = NULL; |
120 | 128 |
121 #endif // defined(OS_CHROMEOS) | 129 #endif // defined(OS_CHROMEOS) |
(...skipping 17 matching lines...) Expand all Loading... | |
139 static L10nResources resources[] = { | 147 static L10nResources resources[] = { |
140 { "helpTitle", IDS_HELP_TITLE }, | 148 { "helpTitle", IDS_HELP_TITLE }, |
141 { "aboutTitle", IDS_ABOUT_TAB_TITLE }, | 149 { "aboutTitle", IDS_ABOUT_TAB_TITLE }, |
142 #if defined(OS_CHROMEOS) | 150 #if defined(OS_CHROMEOS) |
143 { "aboutProductTitle", IDS_PRODUCT_OS_NAME }, | 151 { "aboutProductTitle", IDS_PRODUCT_OS_NAME }, |
144 #else | 152 #else |
145 { "aboutProductTitle", IDS_PRODUCT_NAME }, | 153 { "aboutProductTitle", IDS_PRODUCT_NAME }, |
146 #endif | 154 #endif |
147 { "aboutProductDescription", IDS_ABOUT_PRODUCT_DESCRIPTION }, | 155 { "aboutProductDescription", IDS_ABOUT_PRODUCT_DESCRIPTION }, |
148 { "relaunch", IDS_RELAUNCH_BUTTON }, | 156 { "relaunch", IDS_RELAUNCH_BUTTON }, |
157 { "relaunch", IDS_RELAUNCH_BUTTON }, | |
158 { "relaunchAndPowerwash", IDS_RELAUNCH_AND_POWERWASH_BUTTON }, | |
149 { "productName", IDS_PRODUCT_NAME }, | 159 { "productName", IDS_PRODUCT_NAME }, |
150 { "productCopyright", IDS_ABOUT_VERSION_COPYRIGHT }, | 160 { "productCopyright", IDS_ABOUT_VERSION_COPYRIGHT }, |
151 { "updateCheckStarted", IDS_UPGRADE_CHECK_STARTED }, | 161 { "updateCheckStarted", IDS_UPGRADE_CHECK_STARTED }, |
152 { "upToDate", IDS_UPGRADE_UP_TO_DATE }, | 162 { "upToDate", IDS_UPGRADE_UP_TO_DATE }, |
153 { "updating", IDS_UPGRADE_UPDATING }, | 163 { "updating", IDS_UPGRADE_UPDATING }, |
154 { "updateAlmostDone", IDS_UPGRADE_SUCCESSFUL_RELAUNCH }, | 164 { "updateAlmostDone", IDS_UPGRADE_SUCCESSFUL_RELAUNCH }, |
155 { "getHelpWithChrome", IDS_GET_HELP_USING_CHROME }, | 165 { "getHelpWithChrome", IDS_GET_HELP_USING_CHROME }, |
156 { kResourceReportIssue, IDS_REPORT_AN_ISSUE }, | 166 { kResourceReportIssue, IDS_REPORT_AN_ISSUE }, |
157 #if defined(OS_CHROMEOS) | 167 #if defined(OS_CHROMEOS) |
158 { "platform", IDS_PLATFORM_LABEL }, | 168 { "platform", IDS_PLATFORM_LABEL }, |
159 { "firmware", IDS_ABOUT_PAGE_FIRMWARE }, | 169 { "firmware", IDS_ABOUT_PAGE_FIRMWARE }, |
160 { "showMoreInfo", IDS_SHOW_MORE_INFO }, | 170 { "showMoreInfo", IDS_SHOW_MORE_INFO }, |
161 { "hideMoreInfo", IDS_HIDE_MORE_INFO }, | 171 { "hideMoreInfo", IDS_HIDE_MORE_INFO }, |
162 { "channel", IDS_ABOUT_PAGE_CHANNEL }, | 172 { "channel", IDS_ABOUT_PAGE_CHANNEL }, |
163 { "stable", IDS_ABOUT_PAGE_CHANNEL_STABLE }, | 173 { "stable", IDS_ABOUT_PAGE_CHANNEL_STABLE }, |
164 { "beta", IDS_ABOUT_PAGE_CHANNEL_BETA }, | 174 { "beta", IDS_ABOUT_PAGE_CHANNEL_BETA }, |
165 { "dev", IDS_ABOUT_PAGE_CHANNEL_DEVELOPMENT }, | 175 { "dev", IDS_ABOUT_PAGE_CHANNEL_DEVELOPMENT }, |
166 { "channel-changed", IDS_ABOUT_PAGE_CHANNEL_CHANGED }, | 176 { "channel-changed", IDS_ABOUT_PAGE_CHANNEL_CHANGED }, |
177 { "currentChannelStable", IDS_ABOUT_PAGE_CURRENT_CHANNEL_STABLE }, | |
178 { "currentChannelBeta", IDS_ABOUT_PAGE_CURRENT_CHANNEL_BETA }, | |
179 { "currentChannelDev", IDS_ABOUT_PAGE_CURRENT_CHANNEL_DEV }, | |
180 { "currentChannel", IDS_ABOUT_PAGE_CURRENT_CHANNEL }, | |
181 { "channelChangeButton", IDS_ABOUT_PAGE_CHANNEL_CHANGE_BUTTON }, | |
182 { "channelChangeDisallowedMessage", | |
183 IDS_ABOUT_PAGE_CHANNEL_CHANGE_DISALLOWED_MESSAGE }, | |
184 { "channelChangePageTitle", IDS_ABOUT_PAGE_CHANNEL_CHANGE_PAGE_TITLE }, | |
185 { "channelChangePagePowerwashTitle", | |
186 IDS_ABOUT_PAGE_CHANNEL_CHANGE_PAGE_POWERWASH_TITLE }, | |
187 { "channelChangePagePowerwashMessage", | |
188 IDS_ABOUT_PAGE_CHANNEL_CHANGE_PAGE_POWERWASH_MESSAGE }, | |
189 { "channelChangePageDelayedChangeTitle", | |
190 IDS_ABOUT_PAGE_CHANNEL_CHANGE_PAGE_DELAYED_CHANGE_TITLE }, | |
191 { "channelChangePageDelayedChangeMessage", | |
192 IDS_ABOUT_PAGE_CHANNEL_CHANGE_PAGE_DELAYED_CHANGE_MESSAGE }, | |
193 { "channelChangePageUnstableTitle", | |
194 IDS_ABOUT_PAGE_CHANNEL_CHANGE_PAGE_UNSTABLE_TITLE }, | |
195 { "channelChangePageUnstableMessage", | |
196 IDS_ABOUT_PAGE_CHANNEL_CHANGE_PAGE_UNSTABLE_MESSAGE }, | |
197 { "channelChangePagePowerwashButton", | |
198 IDS_ABOUT_PAGE_CHANNEL_CHANGE_PAGE_POWERWASH_BUTTON }, | |
199 { "channelChangePageChangeButton", | |
200 IDS_ABOUT_PAGE_CHANNEL_CHANGE_PAGE_CHANGE_BUTTON }, | |
201 { "channelChangePageCancelButton", | |
202 IDS_ABOUT_PAGE_CHANNEL_CHANGE_PAGE_CANCEL_BUTTON }, | |
167 { "webkit", IDS_WEBKIT }, | 203 { "webkit", IDS_WEBKIT }, |
168 { "userAgent", IDS_ABOUT_VERSION_USER_AGENT }, | 204 { "userAgent", IDS_ABOUT_VERSION_USER_AGENT }, |
169 { "commandLine", IDS_ABOUT_VERSION_COMMAND_LINE }, | 205 { "commandLine", IDS_ABOUT_VERSION_COMMAND_LINE }, |
170 { "buildDate", IDS_ABOUT_VERSION_BUILD_DATE }, | 206 { "buildDate", IDS_ABOUT_VERSION_BUILD_DATE }, |
171 #endif | 207 #endif |
172 #if defined(OS_MACOSX) | 208 #if defined(OS_MACOSX) |
173 { "promote", IDS_ABOUT_CHROME_PROMOTE_UPDATER }, | 209 { "promote", IDS_ABOUT_CHROME_PROMOTE_UPDATER }, |
174 { "learnMore", IDS_LEARN_MORE }, | 210 { "learnMore", IDS_LEARN_MORE }, |
175 #endif | 211 #endif |
176 }; | 212 }; |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
230 | 266 |
231 web_ui()->RegisterMessageCallback("onPageLoaded", | 267 web_ui()->RegisterMessageCallback("onPageLoaded", |
232 base::Bind(&HelpHandler::OnPageLoaded, base::Unretained(this))); | 268 base::Bind(&HelpHandler::OnPageLoaded, base::Unretained(this))); |
233 web_ui()->RegisterMessageCallback("relaunchNow", | 269 web_ui()->RegisterMessageCallback("relaunchNow", |
234 base::Bind(&HelpHandler::RelaunchNow, base::Unretained(this))); | 270 base::Bind(&HelpHandler::RelaunchNow, base::Unretained(this))); |
235 web_ui()->RegisterMessageCallback("openFeedbackDialog", | 271 web_ui()->RegisterMessageCallback("openFeedbackDialog", |
236 base::Bind(&HelpHandler::OpenFeedbackDialog, base::Unretained(this))); | 272 base::Bind(&HelpHandler::OpenFeedbackDialog, base::Unretained(this))); |
237 web_ui()->RegisterMessageCallback("openHelpPage", | 273 web_ui()->RegisterMessageCallback("openHelpPage", |
238 base::Bind(&HelpHandler::OpenHelpPage, base::Unretained(this))); | 274 base::Bind(&HelpHandler::OpenHelpPage, base::Unretained(this))); |
239 #if defined(OS_CHROMEOS) | 275 #if defined(OS_CHROMEOS) |
240 web_ui()->RegisterMessageCallback("setReleaseTrack", | 276 web_ui()->RegisterMessageCallback("setChannel", |
241 base::Bind(&HelpHandler::SetReleaseTrack, base::Unretained(this))); | 277 base::Bind(&HelpHandler::SetChannel, base::Unretained(this))); |
242 #endif | 278 #endif |
243 #if defined(OS_MACOSX) | 279 #if defined(OS_MACOSX) |
244 web_ui()->RegisterMessageCallback("promoteUpdater", | 280 web_ui()->RegisterMessageCallback("promoteUpdater", |
245 base::Bind(&HelpHandler::PromoteUpdater, base::Unretained(this))); | 281 base::Bind(&HelpHandler::PromoteUpdater, base::Unretained(this))); |
246 #endif | 282 #endif |
247 } | 283 } |
248 | 284 |
249 void HelpHandler::Observe(int type, const content::NotificationSource& source, | 285 void HelpHandler::Observe(int type, const content::NotificationSource& source, |
250 const content::NotificationDetails& details) { | 286 const content::NotificationDetails& details) { |
251 switch (type) { | 287 switch (type) { |
(...skipping 19 matching lines...) Expand all Loading... | |
271 loader_.GetVersion( | 307 loader_.GetVersion( |
272 chromeos::VersionLoader::VERSION_FULL, | 308 chromeos::VersionLoader::VERSION_FULL, |
273 base::Bind(&HelpHandler::OnOSVersion, base::Unretained(this)), | 309 base::Bind(&HelpHandler::OnOSVersion, base::Unretained(this)), |
274 &tracker_); | 310 &tracker_); |
275 loader_.GetFirmware( | 311 loader_.GetFirmware( |
276 base::Bind(&HelpHandler::OnOSFirmware, base::Unretained(this)), | 312 base::Bind(&HelpHandler::OnOSFirmware, base::Unretained(this)), |
277 &tracker_); | 313 &tracker_); |
278 | 314 |
279 web_ui()->CallJavascriptFunction( | 315 web_ui()->CallJavascriptFunction( |
280 "help.HelpPage.updateEnableReleaseChannel", | 316 "help.HelpPage.updateEnableReleaseChannel", |
281 base::FundamentalValue(CanChangeReleaseChannel())); | 317 base::FundamentalValue(CanChangeChannel())); |
282 | 318 |
283 if (g_build_date_string == NULL) { | 319 if (g_build_date_string == NULL) { |
284 // If |g_build_date_string| is |NULL|, the date has not yet been assigned. | 320 // If |g_build_date_string| is |NULL|, the date has not yet been assigned. |
285 // Get the date of the last lsb-release file modification. | 321 // Get the date of the last lsb-release file modification. |
286 base::FileUtilProxy::GetFileInfo( | 322 base::FileUtilProxy::GetFileInfo( |
287 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::FILE), | 323 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::FILE), |
288 base::SysInfo::GetLsbReleaseFilePath(), | 324 base::SysInfo::GetLsbReleaseFilePath(), |
289 base::Bind(&HelpHandler::ProcessLsbFileInfo, | 325 base::Bind(&HelpHandler::ProcessLsbFileInfo, |
290 weak_factory_.GetWeakPtr())); | 326 weak_factory_.GetWeakPtr())); |
291 } else { | 327 } else { |
292 web_ui()->CallJavascriptFunction("help.HelpPage.setBuildDate", | 328 web_ui()->CallJavascriptFunction("help.HelpPage.setBuildDate", |
293 *g_build_date_string); | 329 *g_build_date_string); |
294 } | 330 } |
295 #endif // defined(OS_CHROMEOS) | 331 #endif // defined(OS_CHROMEOS) |
296 | 332 |
297 version_updater_->CheckForUpdate( | 333 version_updater_->CheckForUpdate( |
298 base::Bind(&HelpHandler::SetUpdateStatus, base::Unretained(this)) | 334 base::Bind(&HelpHandler::SetUpdateStatus, base::Unretained(this)) |
299 #if defined(OS_MACOSX) | 335 #if defined(OS_MACOSX) |
300 , base::Bind(&HelpHandler::SetPromotionState, base::Unretained(this)) | 336 , base::Bind(&HelpHandler::SetPromotionState, base::Unretained(this)) |
301 #endif | 337 #endif |
302 ); | 338 ); |
303 | 339 |
304 #if defined(OS_CHROMEOS) | 340 #if defined(OS_CHROMEOS) |
305 version_updater_->GetReleaseChannel( | 341 web_ui()->CallJavascriptFunction( |
306 base::Bind(&HelpHandler::OnReleaseChannel, base::Unretained(this))); | 342 "help.HelpPage.updateIsEnterpriseManaged", |
343 base::FundamentalValue(IsEnterpriseManaged())); | |
344 version_updater_->GetChannel(true, | |
Nikita (slow)
2013/06/21 12:58:04
nit: Please add comments for true/false value (1st
ygorshenin1
2013/06/21 17:24:58
Done.
| |
345 base::Bind(&HelpHandler::OnCurrentChannel, weak_factory_.GetWeakPtr())); | |
346 version_updater_->GetChannel(false, | |
347 base::Bind(&HelpHandler::OnTargetChannel, weak_factory_.GetWeakPtr())); | |
307 #endif | 348 #endif |
308 } | 349 } |
309 | 350 |
310 #if defined(OS_MACOSX) | 351 #if defined(OS_MACOSX) |
311 void HelpHandler::PromoteUpdater(const ListValue* args) { | 352 void HelpHandler::PromoteUpdater(const ListValue* args) { |
312 version_updater_->PromoteUpdater(); | 353 version_updater_->PromoteUpdater(); |
313 } | 354 } |
314 #endif | 355 #endif |
315 | 356 |
316 void HelpHandler::RelaunchNow(const ListValue* args) { | 357 void HelpHandler::RelaunchNow(const ListValue* args) { |
(...skipping 10 matching lines...) Expand all Loading... | |
327 | 368 |
328 void HelpHandler::OpenHelpPage(const base::ListValue* args) { | 369 void HelpHandler::OpenHelpPage(const base::ListValue* args) { |
329 DCHECK(args->empty()); | 370 DCHECK(args->empty()); |
330 Browser* browser = chrome::FindBrowserWithWebContents( | 371 Browser* browser = chrome::FindBrowserWithWebContents( |
331 web_ui()->GetWebContents()); | 372 web_ui()->GetWebContents()); |
332 chrome::ShowHelp(browser, chrome::HELP_SOURCE_WEBUI); | 373 chrome::ShowHelp(browser, chrome::HELP_SOURCE_WEBUI); |
333 } | 374 } |
334 | 375 |
335 #if defined(OS_CHROMEOS) | 376 #if defined(OS_CHROMEOS) |
336 | 377 |
337 void HelpHandler::SetReleaseTrack(const ListValue* args) { | 378 void HelpHandler::SetChannel(const ListValue* args) { |
338 if (!CanChangeReleaseChannel()) { | 379 DCHECK(args->GetSize() == 2); |
380 | |
381 if (!CanChangeChannel()) { | |
339 LOG(WARNING) << "Non-owner tried to change release track."; | 382 LOG(WARNING) << "Non-owner tried to change release track."; |
340 return; | 383 return; |
341 } | 384 } |
342 | 385 |
343 const std::string channel = UTF16ToUTF8(ExtractStringValue(args)); | 386 base::string16 channel; |
344 version_updater_->SetReleaseChannel(channel); | 387 bool is_powerwash_allowed; |
345 // On enterprise machines we can only use SetReleaseChannel to store the | 388 if (!args->GetString(0, &channel) || |
346 // user choice in the lsb-release file but we can not modify the policy blob. | 389 !args->GetBoolean(1, &is_powerwash_allowed)) { |
347 // Therefore we only call SetString if the device is locally owned and the | 390 LOG(ERROR) << "Can't parse SetReleaseTrack() args"; |
348 // currently logged in user is the owner. | 391 return; |
392 } | |
393 | |
394 version_updater_->SetChannel(UTF16ToUTF8(channel), is_powerwash_allowed); | |
349 if (chromeos::UserManager::Get()->IsCurrentUserOwner()) { | 395 if (chromeos::UserManager::Get()->IsCurrentUserOwner()) { |
350 chromeos::CrosSettings::Get()->SetString(chromeos::kReleaseChannel, | |
351 channel); | |
352 // Check for update after switching release channel. | 396 // Check for update after switching release channel. |
353 version_updater_->CheckForUpdate(base::Bind(&HelpHandler::SetUpdateStatus, | 397 version_updater_->CheckForUpdate(base::Bind(&HelpHandler::SetUpdateStatus, |
354 base::Unretained(this))); | 398 base::Unretained(this))); |
355 } | 399 } |
356 } | 400 } |
357 | 401 |
358 #endif // defined(OS_CHROMEOS) | 402 #endif // defined(OS_CHROMEOS) |
359 | 403 |
360 void HelpHandler::SetUpdateStatus(VersionUpdater::Status status, | 404 void HelpHandler::SetUpdateStatus(VersionUpdater::Status status, |
361 int progress, const string16& message) { | 405 int progress, const string16& message) { |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
440 void HelpHandler::OnOSVersion(const std::string& version) { | 484 void HelpHandler::OnOSVersion(const std::string& version) { |
441 web_ui()->CallJavascriptFunction("help.HelpPage.setOSVersion", | 485 web_ui()->CallJavascriptFunction("help.HelpPage.setOSVersion", |
442 base::StringValue(version)); | 486 base::StringValue(version)); |
443 } | 487 } |
444 | 488 |
445 void HelpHandler::OnOSFirmware(const std::string& firmware) { | 489 void HelpHandler::OnOSFirmware(const std::string& firmware) { |
446 web_ui()->CallJavascriptFunction("help.HelpPage.setOSFirmware", | 490 web_ui()->CallJavascriptFunction("help.HelpPage.setOSFirmware", |
447 base::StringValue(firmware)); | 491 base::StringValue(firmware)); |
448 } | 492 } |
449 | 493 |
450 void HelpHandler::OnReleaseChannel(const std::string& channel) { | 494 void HelpHandler::OnCurrentChannel(const std::string& channel) { |
451 web_ui()->CallJavascriptFunction( | 495 web_ui()->CallJavascriptFunction( |
452 "help.HelpPage.updateSelectedChannel", base::StringValue(channel)); | 496 "help.HelpPage.updateCurrentChannel", base::StringValue(channel)); |
497 } | |
498 | |
499 void HelpHandler::OnTargetChannel(const std::string& channel) { | |
500 web_ui()->CallJavascriptFunction( | |
501 "help.HelpPage.updateTargetChannel", base::StringValue(channel)); | |
453 } | 502 } |
454 | 503 |
455 void HelpHandler::ProcessLsbFileInfo( | 504 void HelpHandler::ProcessLsbFileInfo( |
456 base::PlatformFileError error, const base::PlatformFileInfo& file_info) { | 505 base::PlatformFileError error, const base::PlatformFileInfo& file_info) { |
457 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 506 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
458 | 507 |
459 // If |g_build_date_string| is not |NULL|, then the file's information has | 508 // If |g_build_date_string| is not |NULL|, then the file's information has |
460 // already been retrieved by another tab. | 509 // already been retrieved by another tab. |
461 if (g_build_date_string == NULL) { | 510 if (g_build_date_string == NULL) { |
462 base::Time time; | 511 base::Time time; |
(...skipping 10 matching lines...) Expand all Loading... | |
473 | 522 |
474 // Note that this string will be internationalized. | 523 // Note that this string will be internationalized. |
475 string16 build_date = base::TimeFormatFriendlyDate(time); | 524 string16 build_date = base::TimeFormatFriendlyDate(time); |
476 g_build_date_string = Value::CreateStringValue(build_date); | 525 g_build_date_string = Value::CreateStringValue(build_date); |
477 } | 526 } |
478 | 527 |
479 web_ui()->CallJavascriptFunction("help.HelpPage.setBuildDate", | 528 web_ui()->CallJavascriptFunction("help.HelpPage.setBuildDate", |
480 *g_build_date_string); | 529 *g_build_date_string); |
481 } | 530 } |
482 #endif // defined(OS_CHROMEOS) | 531 #endif // defined(OS_CHROMEOS) |
OLD | NEW |