Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3161)

Unified Diff: chrome/browser/ui/webui/local_discovery/local_discovery_ui.cc

Issue 20070002: Demo UI for device discovery and registration (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Added FILE_PATH_LITERAL macro to fix windows compile problem Created 7 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/webui/local_discovery/local_discovery_ui.cc
diff --git a/chrome/browser/ui/webui/local_discovery/local_discovery_ui.cc b/chrome/browser/ui/webui/local_discovery/local_discovery_ui.cc
index e7a81d46a6b479a3a09b579a832e28faa40e2250..c898f127a74430ee8bf00bc2991500d21f25237b 100644
--- a/chrome/browser/ui/webui/local_discovery/local_discovery_ui.cc
+++ b/chrome/browser/ui/webui/local_discovery/local_discovery_ui.cc
@@ -10,6 +10,7 @@
#include "content/public/browser/web_ui.h"
#include "content/public/browser/web_ui_data_source.h"
#include "grit/browser_resources.h"
+#include "grit/generated_resources.h"
namespace {
@@ -20,6 +21,31 @@ content::WebUIDataSource* CreateLocalDiscoveryHTMLSource() {
source->SetDefaultResource(IDR_LOCAL_DISCOVERY_HTML);
source->AddResourcePath("local_discovery.css", IDR_LOCAL_DISCOVERY_CSS);
source->AddResourcePath("local_discovery.js", IDR_LOCAL_DISCOVERY_JS);
+
+ source->SetUseJsonJSFormatV2();
+ source->AddLocalizedString("serviceName",
+ IDS_LOCAL_DISCOVERY_SERVICE_NAME);
+ source->AddLocalizedString("serviceDomain",
+ IDS_LOCAL_DISCOVERY_SERVICE_DOMAIN);
+ source->AddLocalizedString("servicePort",
+ IDS_LOCAL_DISCOVERY_SERVICE_PORT);
+ source->AddLocalizedString("serviceIp",
+ IDS_LOCAL_DISCOVERY_SERVICE_IP);
+ source->AddLocalizedString("serviceLastseen",
+ IDS_LOCAL_DISCOVERY_SERVICE_LASTSEEN);
+ source->AddLocalizedString("serviceRegister",
+ IDS_LOCAL_DISCOVERY_SERVICE_REGISTER);
+ source->AddLocalizedString("registeringService",
+ IDS_LOCAL_DISCOVERY_REGISTERING_SERVICE);
+ source->AddLocalizedString("registrationFailed",
+ IDS_LOCAL_DISCOVERY_REGISTRATION_FAILED);
+ source->AddLocalizedString("registrationSucceeded",
+ IDS_LOCAL_DISCOVERY_REGISTRATION_SUCCEEDED);
+ source->AddLocalizedString("registered",
+ IDS_LOCAL_DISCOVERY_REGISTERED);
+
+ source->SetJsonPath("strings.js");
+
return source;
}
@@ -33,5 +59,5 @@ LocalDiscoveryUI::LocalDiscoveryUI(content::WebUI* web_ui)
// TODO(gene): Use LocalDiscoveryUIHandler to send updated to the devices
// page. For example
- // web_ui->AddMessageHandler(new LocalDiscoveryUIHandler());
+ web_ui->AddMessageHandler(local_discovery::LocalDiscoveryUIHandler::Create());
}

Powered by Google App Engine
This is Rietveld 408576698