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/nacl_ui.h" | 5 #include "chrome/browser/ui/webui/nacl_ui.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
246 } | 246 } |
247 } | 247 } |
248 AddLineBreak(list); | 248 AddLineBreak(list); |
249 } | 249 } |
250 | 250 |
251 void NaClDomHandler::AddPnaclInfo(base::ListValue* list) { | 251 void NaClDomHandler::AddPnaclInfo(base::ListValue* list) { |
252 // Display whether PNaCl is enabled. | 252 // Display whether PNaCl is enabled. |
253 base::string16 pnacl_enabled_string = ASCIIToUTF16("Enabled"); | 253 base::string16 pnacl_enabled_string = ASCIIToUTF16("Enabled"); |
254 if (!isPluginEnabled(0)) { | 254 if (!isPluginEnabled(0)) { |
255 pnacl_enabled_string = ASCIIToUTF16("Disabled in profile prefs"); | 255 pnacl_enabled_string = ASCIIToUTF16("Disabled in profile prefs"); |
256 } else if (CommandLine::ForCurrentProcess()->HasSwitch( | |
257 switches::kDisablePnacl)) { | |
258 pnacl_enabled_string = ASCIIToUTF16("Disabled by flag '--disable-pnacl'"); | |
259 } | 256 } |
260 AddPair(list, | 257 AddPair(list, |
261 ASCIIToUTF16("Portable Native Client (PNaCl)"), | 258 ASCIIToUTF16("Portable Native Client (PNaCl)"), |
262 pnacl_enabled_string); | 259 pnacl_enabled_string); |
263 | 260 |
264 // Obtain the version of the PNaCl translator. | 261 // Obtain the version of the PNaCl translator. |
265 base::FilePath pnacl_path; | 262 base::FilePath pnacl_path; |
266 bool got_path = PathService::Get(chrome::DIR_PNACL_COMPONENT, &pnacl_path); | 263 bool got_path = PathService::Get(chrome::DIR_PNACL_COMPONENT, &pnacl_path); |
267 if (!got_path || pnacl_path.empty() || !pnacl_path_exists_) { | 264 if (!got_path || pnacl_path.empty() || !pnacl_path_exists_) { |
268 AddPair(list, | 265 AddPair(list, |
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
388 | 385 |
389 NaClUI::NaClUI(content::WebUI* web_ui) : WebUIController(web_ui) { | 386 NaClUI::NaClUI(content::WebUI* web_ui) : WebUIController(web_ui) { |
390 content::RecordAction(UserMetricsAction("ViewAboutNaCl")); | 387 content::RecordAction(UserMetricsAction("ViewAboutNaCl")); |
391 | 388 |
392 web_ui->AddMessageHandler(new NaClDomHandler()); | 389 web_ui->AddMessageHandler(new NaClDomHandler()); |
393 | 390 |
394 // Set up the about:nacl source. | 391 // Set up the about:nacl source. |
395 Profile* profile = Profile::FromWebUI(web_ui); | 392 Profile* profile = Profile::FromWebUI(web_ui); |
396 content::WebUIDataSource::Add(profile, CreateNaClUIHTMLSource()); | 393 content::WebUIDataSource::Add(profile, CreateNaClUIHTMLSource()); |
397 } | 394 } |
OLD | NEW |