| 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 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 46 using content::BrowserThread; | 46 using content::BrowserThread; |
| 47 using content::PluginService; | 47 using content::PluginService; |
| 48 using content::WebUIMessageHandler; | 48 using content::WebUIMessageHandler; |
| 49 | 49 |
| 50 namespace { | 50 namespace { |
| 51 | 51 |
| 52 content::WebUIDataSource* CreateNaClUIHTMLSource() { | 52 content::WebUIDataSource* CreateNaClUIHTMLSource() { |
| 53 content::WebUIDataSource* source = | 53 content::WebUIDataSource* source = |
| 54 content::WebUIDataSource::Create(chrome::kChromeUINaClHost); | 54 content::WebUIDataSource::Create(chrome::kChromeUINaClHost); |
| 55 | 55 |
| 56 source->SetUseJsonJSFormatV2(); | |
| 57 source->AddLocalizedString("loadingMessage", IDS_NACL_LOADING_MESSAGE); | 56 source->AddLocalizedString("loadingMessage", IDS_NACL_LOADING_MESSAGE); |
| 58 source->AddLocalizedString("naclLongTitle", IDS_NACL_TITLE_MESSAGE); | 57 source->AddLocalizedString("naclLongTitle", IDS_NACL_TITLE_MESSAGE); |
| 59 source->SetJsonPath("strings.js"); | 58 source->SetJsonPath("strings.js"); |
| 60 source->AddResourcePath("about_nacl.css", IDR_ABOUT_NACL_CSS); | 59 source->AddResourcePath("about_nacl.css", IDR_ABOUT_NACL_CSS); |
| 61 source->AddResourcePath("about_nacl.js", IDR_ABOUT_NACL_JS); | 60 source->AddResourcePath("about_nacl.js", IDR_ABOUT_NACL_JS); |
| 62 source->SetDefaultResource(IDR_ABOUT_NACL_HTML); | 61 source->SetDefaultResource(IDR_ABOUT_NACL_HTML); |
| 63 return source; | 62 return source; |
| 64 } | 63 } |
| 65 | 64 |
| 66 //////////////////////////////////////////////////////////////////////////////// | 65 //////////////////////////////////////////////////////////////////////////////// |
| (...skipping 316 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 383 | 382 |
| 384 NaClUI::NaClUI(content::WebUI* web_ui) : WebUIController(web_ui) { | 383 NaClUI::NaClUI(content::WebUI* web_ui) : WebUIController(web_ui) { |
| 385 content::RecordAction(UserMetricsAction("ViewAboutNaCl")); | 384 content::RecordAction(UserMetricsAction("ViewAboutNaCl")); |
| 386 | 385 |
| 387 web_ui->AddMessageHandler(new NaClDomHandler()); | 386 web_ui->AddMessageHandler(new NaClDomHandler()); |
| 388 | 387 |
| 389 // Set up the about:nacl source. | 388 // Set up the about:nacl source. |
| 390 Profile* profile = Profile::FromWebUI(web_ui); | 389 Profile* profile = Profile::FromWebUI(web_ui); |
| 391 content::WebUIDataSource::Add(profile, CreateNaClUIHTMLSource()); | 390 content::WebUIDataSource::Add(profile, CreateNaClUIHTMLSource()); |
| 392 } | 391 } |
| OLD | NEW |