OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/chromeos/nfc_debug_ui.h" | 5 #include "chrome/browser/ui/webui/chromeos/nfc_debug_ui.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
9 #include "base/values.h" | 9 #include "base/values.h" |
10 #include "chrome/browser/profiles/profile.h" | 10 #include "chrome/browser/profiles/profile.h" |
(...skipping 658 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
669 web_ui()->CallJavascriptFunction(kOnNfcTagInfoChangedFunction, data); | 669 web_ui()->CallJavascriptFunction(kOnNfcTagInfoChangedFunction, data); |
670 } | 670 } |
671 | 671 |
672 } // namespace | 672 } // namespace |
673 | 673 |
674 NfcDebugUI::NfcDebugUI(content::WebUI* web_ui) | 674 NfcDebugUI::NfcDebugUI(content::WebUI* web_ui) |
675 : content::WebUIController(web_ui) { | 675 : content::WebUIController(web_ui) { |
676 web_ui->AddMessageHandler(new NfcDebugMessageHandler()); | 676 web_ui->AddMessageHandler(new NfcDebugMessageHandler()); |
677 | 677 |
678 content::WebUIDataSource* html_source = | 678 content::WebUIDataSource* html_source = |
679 content::WebUIDataSource::Create(chrome::kChromeUINfcDebugHost); | 679 content::WebUIDataSource::Create(chrome::kChromeUINfcDebugHost); |
680 html_source->SetUseJsonJSFormatV2(); | |
681 | 680 |
682 html_source->AddLocalizedString("titleText", IDS_NFC_DEBUG_TITLE); | 681 html_source->AddLocalizedString("titleText", IDS_NFC_DEBUG_TITLE); |
683 html_source->AddLocalizedString("notSupportedText", | 682 html_source->AddLocalizedString("notSupportedText", |
684 IDS_NFC_DEBUG_NOT_SUPPORTED); | 683 IDS_NFC_DEBUG_NOT_SUPPORTED); |
685 html_source->AddLocalizedString("adapterHeaderText", | 684 html_source->AddLocalizedString("adapterHeaderText", |
686 IDS_NFC_DEBUG_ADAPTER_HEADER); | 685 IDS_NFC_DEBUG_ADAPTER_HEADER); |
687 html_source->AddLocalizedString("adapterPowerOnText", | 686 html_source->AddLocalizedString("adapterPowerOnText", |
688 IDS_NFC_DEBUG_ADAPTER_POWER_ON); | 687 IDS_NFC_DEBUG_ADAPTER_POWER_ON); |
689 html_source->AddLocalizedString("adapterPowerOffText", | 688 html_source->AddLocalizedString("adapterPowerOffText", |
690 IDS_NFC_DEBUG_ADAPTER_POWER_OFF); | 689 IDS_NFC_DEBUG_ADAPTER_POWER_OFF); |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
743 html_source->SetDefaultResource(IDR_NFC_DEBUG_HTML); | 742 html_source->SetDefaultResource(IDR_NFC_DEBUG_HTML); |
744 | 743 |
745 Profile* profile = Profile::FromWebUI(web_ui); | 744 Profile* profile = Profile::FromWebUI(web_ui); |
746 content::WebUIDataSource::Add(profile, html_source); | 745 content::WebUIDataSource::Add(profile, html_source); |
747 } | 746 } |
748 | 747 |
749 NfcDebugUI::~NfcDebugUI() { | 748 NfcDebugUI::~NfcDebugUI() { |
750 } | 749 } |
751 | 750 |
752 } // namespace chromeos | 751 } // namespace chromeos |
OLD | NEW |