| 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 <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 354 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 365 FROM_HERE, | 365 FROM_HERE, |
| 366 base::Bind(&CheckPathAndVersion, version_string), | 366 base::Bind(&CheckPathAndVersion, version_string), |
| 367 base::Bind(&NaClDomHandler::DidCheckPathAndVersion, | 367 base::Bind(&NaClDomHandler::DidCheckPathAndVersion, |
| 368 weak_ptr_factory_.GetWeakPtr(), | 368 weak_ptr_factory_.GetWeakPtr(), |
| 369 base::Owned(version_string))); | 369 base::Owned(version_string))); |
| 370 return; | 370 return; |
| 371 } | 371 } |
| 372 | 372 |
| 373 base::DictionaryValue naclInfo; | 373 base::DictionaryValue naclInfo; |
| 374 PopulatePageInformation(&naclInfo); | 374 PopulatePageInformation(&naclInfo); |
| 375 web_ui()->CallJavascriptFunction("nacl.returnNaClInfo", naclInfo); | 375 web_ui()->CallJavascriptFunctionUnsafe("nacl.returnNaClInfo", naclInfo); |
| 376 } | 376 } |
| 377 | 377 |
| 378 } // namespace | 378 } // namespace |
| 379 | 379 |
| 380 /////////////////////////////////////////////////////////////////////////////// | 380 /////////////////////////////////////////////////////////////////////////////// |
| 381 // | 381 // |
| 382 // NaClUI | 382 // NaClUI |
| 383 // | 383 // |
| 384 /////////////////////////////////////////////////////////////////////////////// | 384 /////////////////////////////////////////////////////////////////////////////// |
| 385 | 385 |
| 386 NaClUI::NaClUI(content::WebUI* web_ui) : WebUIController(web_ui) { | 386 NaClUI::NaClUI(content::WebUI* web_ui) : WebUIController(web_ui) { |
| 387 content::RecordAction(UserMetricsAction("ViewAboutNaCl")); | 387 content::RecordAction(UserMetricsAction("ViewAboutNaCl")); |
| 388 | 388 |
| 389 web_ui->AddMessageHandler(new NaClDomHandler()); | 389 web_ui->AddMessageHandler(new NaClDomHandler()); |
| 390 | 390 |
| 391 // Set up the about:nacl source. | 391 // Set up the about:nacl source. |
| 392 Profile* profile = Profile::FromWebUI(web_ui); | 392 Profile* profile = Profile::FromWebUI(web_ui); |
| 393 content::WebUIDataSource::Add(profile, CreateNaClUIHTMLSource()); | 393 content::WebUIDataSource::Add(profile, CreateNaClUIHTMLSource()); |
| 394 } | 394 } |
| OLD | NEW |