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 258 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
269 AddPair(list, | 269 AddPair(list, |
270 ASCIIToUTF16("PNaCl translator version"), | 270 ASCIIToUTF16("PNaCl translator version"), |
271 ASCIIToUTF16(pnacl_version_string_)); | 271 ASCIIToUTF16(pnacl_version_string_)); |
272 } | 272 } |
273 AddLineBreak(list); | 273 AddLineBreak(list); |
274 } | 274 } |
275 | 275 |
276 void NaClDomHandler::AddNaClInfo(base::ListValue* list) { | 276 void NaClDomHandler::AddNaClInfo(base::ListValue* list) { |
277 base::string16 nacl_enabled_string = ASCIIToUTF16("Disabled"); | 277 base::string16 nacl_enabled_string = ASCIIToUTF16("Disabled"); |
278 if (isPluginEnabled(0) && | 278 if (isPluginEnabled(0) && |
279 CommandLine::ForCurrentProcess()->HasSwitch(switches::kEnableNaCl)) { | 279 base::CommandLine::ForCurrentProcess()->HasSwitch( |
| 280 switches::kEnableNaCl)) { |
280 nacl_enabled_string = ASCIIToUTF16("Enabled by flag '--enable-nacl'"); | 281 nacl_enabled_string = ASCIIToUTF16("Enabled by flag '--enable-nacl'"); |
281 } | 282 } |
282 AddPair(list, | 283 AddPair(list, |
283 ASCIIToUTF16("Native Client (non-portable, outside web store)"), | 284 ASCIIToUTF16("Native Client (non-portable, outside web store)"), |
284 nacl_enabled_string); | 285 nacl_enabled_string); |
285 AddLineBreak(list); | 286 AddLineBreak(list); |
286 } | 287 } |
287 | 288 |
288 void NaClDomHandler::HandleRequestNaClInfo(const base::ListValue* args) { | 289 void NaClDomHandler::HandleRequestNaClInfo(const base::ListValue* args) { |
289 page_has_requested_data_ = true; | 290 page_has_requested_data_ = true; |
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
382 | 383 |
383 NaClUI::NaClUI(content::WebUI* web_ui) : WebUIController(web_ui) { | 384 NaClUI::NaClUI(content::WebUI* web_ui) : WebUIController(web_ui) { |
384 content::RecordAction(UserMetricsAction("ViewAboutNaCl")); | 385 content::RecordAction(UserMetricsAction("ViewAboutNaCl")); |
385 | 386 |
386 web_ui->AddMessageHandler(new NaClDomHandler()); | 387 web_ui->AddMessageHandler(new NaClDomHandler()); |
387 | 388 |
388 // Set up the about:nacl source. | 389 // Set up the about:nacl source. |
389 Profile* profile = Profile::FromWebUI(web_ui); | 390 Profile* profile = Profile::FromWebUI(web_ui); |
390 content::WebUIDataSource::Add(profile, CreateNaClUIHTMLSource()); | 391 content::WebUIDataSource::Add(profile, CreateNaClUIHTMLSource()); |
391 } | 392 } |
OLD | NEW |