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

Unified Diff: chrome/browser/ui/webui/chromeos/emulator/device_emulator_ui.cc

Issue 1999593002: Update chrome://device-emulator with newer Polymer guidelines (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: narrow mode drawer + webui safety Created 4 years, 7 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
« no previous file with comments | « chrome/browser/ui/webui/chromeos/emulator/device_emulator_message_handler.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/webui/chromeos/emulator/device_emulator_ui.cc
diff --git a/chrome/browser/ui/webui/chromeos/emulator/device_emulator_ui.cc b/chrome/browser/ui/webui/chromeos/emulator/device_emulator_ui.cc
index 928d30fd5b4c622d6ae7fa5fa62a5a9ba7210e32..a9fdf31b09ed68d3471cae0220317edb5d8a56a4 100644
--- a/chrome/browser/ui/webui/chromeos/emulator/device_emulator_ui.cc
+++ b/chrome/browser/ui/webui/chromeos/emulator/device_emulator_ui.cc
@@ -4,7 +4,6 @@
#include "chrome/browser/ui/webui/chromeos/emulator/device_emulator_ui.h"
-#include "base/strings/string_number_conversions.h"
#include "base/values.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/ui/webui/chromeos/emulator/device_emulator_message_handler.h"
@@ -22,19 +21,28 @@ content::WebUIDataSource* CreateDeviceEmulatorUIDataSource() {
content::WebUIDataSource* html =
content::WebUIDataSource::Create(chrome::kChromeUIDeviceEmulatorHost);
- html->SetJsonPath("strings.js");
-
// Add resources.
- html->AddResourcePath("device_emulator.css", IDR_DEVICE_EMULATOR_CSS);
- html->AddResourcePath("device_emulator.js", IDR_DEVICE_EMULATOR_JS);
- html->AddResourcePath("shared_styles.css",
- IDR_DEVICE_EMULATOR_SHARED_STYLES_CSS);
- html->AddResourcePath("audio_settings.html", IDR_AUDIO_SETTINGS_HTML);
- html->AddResourcePath("audio_settings.js", IDR_AUDIO_SETTINGS_JS);
- html->AddResourcePath("battery_settings.html", IDR_BATTERY_SETTINGS_HTML);
- html->AddResourcePath("battery_settings.js", IDR_BATTERY_SETTINGS_JS);
- html->AddResourcePath("bluetooth_settings.html", IDR_BLUETOOTH_SETTINGS_HTML);
- html->AddResourcePath("bluetooth_settings.js", IDR_BLUETOOTH_SETTINGS_JS);
+ html->AddResourcePath("audio_settings.html",
+ IDR_DEVICE_EMULATOR_AUDIO_SETTINGS_HTML);
+ html->AddResourcePath("audio_settings.js",
+ IDR_DEVICE_EMULATOR_AUDIO_SETTINGS_JS);
+ html->AddResourcePath("battery_settings.html",
+ IDR_DEVICE_EMULATOR_BATTERY_SETTINGS_HTML);
+ html->AddResourcePath("battery_settings.js",
+ IDR_DEVICE_EMULATOR_BATTERY_SETTINGS_JS);
+ html->AddResourcePath("bluetooth_settings.html",
+ IDR_DEVICE_EMULATOR_BLUETOOTH_SETTINGS_HTML);
+ html->AddResourcePath("bluetooth_settings.js",
+ IDR_DEVICE_EMULATOR_BLUETOOTH_SETTINGS_JS);
+ html->AddResourcePath("icons.html", IDR_DEVICE_EMULATOR_ICONS_HTML);
+ html->AddResourcePath("device_emulator_pages.html",
+ IDR_DEVICE_EMULATOR_PAGES_HTML);
+ html->AddResourcePath("device_emulator_pages.js",
+ IDR_DEVICE_EMULATOR_PAGES_JS);
+
+ html->AddResourcePath("shared_styles.html",
+ IDR_DEVICE_EMULATOR_SHARED_STYLES_HTML);
+
html->SetDefaultResource(IDR_DEVICE_EMULATOR_HTML);
return html;
@@ -44,10 +52,7 @@ content::WebUIDataSource* CreateDeviceEmulatorUIDataSource() {
DeviceEmulatorUI::DeviceEmulatorUI(content::WebUI* web_ui)
: WebUIController(web_ui) {
- chromeos::DeviceEmulatorMessageHandler* handler =
- new chromeos::DeviceEmulatorMessageHandler();
- handler->Init();
- web_ui->AddMessageHandler(handler);
+ web_ui->AddMessageHandler(new chromeos::DeviceEmulatorMessageHandler());
content::WebUIDataSource::Add(web_ui->GetWebContents()->GetBrowserContext(),
CreateDeviceEmulatorUIDataSource());
« no previous file with comments | « chrome/browser/ui/webui/chromeos/emulator/device_emulator_message_handler.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698