Index: chrome/browser/ui/webui/settings/about_handler.cc |
diff --git a/chrome/browser/ui/webui/settings/about_handler.cc b/chrome/browser/ui/webui/settings/about_handler.cc |
index 50db13d75a3457ec54d1eae8cb4f559f2722fe6e..1cde7da4da67bdb2fc26857b84cc01386c0629f9 100644 |
--- a/chrome/browser/ui/webui/settings/about_handler.cc |
+++ b/chrome/browser/ui/webui/settings/about_handler.cc |
@@ -192,10 +192,10 @@ base::FilePath FindRegulatoryLabelDir() { |
// Reads the file containing the regulatory label text, if found, relative to |
// the asset directory. Must be called from the blocking pool. |
-std::string ReadRegulatoryLabelText(const base::FilePath& path) { |
+std::string ReadRegulatoryLabelText(const base::FilePath& label_dir) { |
DCHECK(BrowserThread::GetBlockingPool()->RunsTasksOnCurrentThread()); |
base::FilePath text_path(chrome::kChromeOSAssetPath); |
- text_path = text_path.Append(path); |
+ text_path = text_path.Append(label_dir); |
text_path = text_path.AppendASCII(kRegulatoryLabelTextFilename); |
std::string contents; |
@@ -620,8 +620,8 @@ void AboutHandler::SetPromotionState(VersionUpdater::PromotionState state) { |
#if defined(OS_CHROMEOS) |
void AboutHandler::OnRegulatoryLabelDirFound(std::string callback_id, |
- const base::FilePath& path) { |
- if (path.empty()) { |
+ const base::FilePath& label_dir) { |
+ if (label_dir.empty()) { |
dpapad
2016/06/24 16:29:19
label_dir.empty() makes it looks as if this is che
michaelpg
2016/06/24 16:37:27
Done.
|
ResolveJavascriptCallback(base::StringValue(callback_id), |
*base::Value::CreateNullValue()); |
return; |
@@ -629,20 +629,23 @@ void AboutHandler::OnRegulatoryLabelDirFound(std::string callback_id, |
base::PostTaskAndReplyWithResult( |
content::BrowserThread::GetBlockingPool(), FROM_HERE, |
- base::Bind(&ReadRegulatoryLabelText, path), |
+ base::Bind(&ReadRegulatoryLabelText, label_dir), |
base::Bind(&AboutHandler::OnRegulatoryLabelTextRead, |
- weak_factory_.GetWeakPtr(), callback_id, path)); |
+ weak_factory_.GetWeakPtr(), callback_id, label_dir)); |
} |
void AboutHandler::OnRegulatoryLabelTextRead(std::string callback_id, |
- const base::FilePath& path, |
+ const base::FilePath& label_dir, |
const std::string& text) { |
std::unique_ptr<base::DictionaryValue> regulatory_info( |
new base::DictionaryValue); |
// Remove unnecessary whitespace. |
regulatory_info->SetString("text", base::CollapseWhitespaceASCII(text, true)); |
- std::string url = std::string("chrome://") + chrome::kChromeOSAssetHost + |
- "/" + path.MaybeAsASCII(); |
+ |
+ std::string image_path = |
+ label_dir.AppendASCII(kRegulatoryLabelImageFilename).MaybeAsASCII(); |
dpapad
2016/06/24 16:29:19
Ah, thanks for fixing, I understand the bug now.
|
+ std::string url = |
+ std::string("chrome://") + chrome::kChromeOSAssetHost + "/" + image_path; |
regulatory_info->SetString("url", url); |
ResolveJavascriptCallback(base::StringValue(callback_id), *regulatory_info); |