| OLD | NEW | 
|---|
| (Empty) |  | 
|  | 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 
|  | 2 // Use of this source code is governed by a BSD-style license that can be | 
|  | 3 // found in the LICENSE file. | 
|  | 4 | 
|  | 5 #include "chrome/browser/ui/webui/chromeos/emulator/device_emulator_ui.h" | 
|  | 6 | 
|  | 7 #include "chrome/browser/profiles/profile.h" | 
|  | 8 #include "chrome/browser/ui/webui/chromeos/emulator/device_emulator_message_hand
    ler.h" | 
|  | 9 #include "chrome/common/url_constants.h" | 
|  | 10 #include "content/public/browser/web_ui.h" | 
|  | 11 #include "content/public/browser/web_ui_data_source.h" | 
|  | 12 #include "grit/browser_resources.h" | 
|  | 13 #include "grit/generated_resources.h" | 
|  | 14 | 
|  | 15 namespace { | 
|  | 16 | 
|  | 17 // Create data source for chrome://device-emulator/. | 
|  | 18 content::WebUIDataSource* CreateDeviceEmulatorUIDataSource() { | 
|  | 19   content::WebUIDataSource* html = | 
|  | 20       content::WebUIDataSource::Create(chrome::kChromeUIDeviceEmulatorHost); | 
|  | 21 | 
|  | 22   // Add resources. | 
|  | 23   html->AddResourcePath("device_emulator.css", IDR_DEVICE_EMULATOR_CSS); | 
|  | 24   html->AddResourcePath("device_emulator.js", IDR_DEVICE_EMULATOR_JS); | 
|  | 25   html->SetDefaultResource(IDR_DEVICE_EMULATOR_HTML); | 
|  | 26 | 
|  | 27   return html; | 
|  | 28 } | 
|  | 29 | 
|  | 30 }  // namespace | 
|  | 31 | 
|  | 32 DeviceEmulatorUI::DeviceEmulatorUI(content::WebUI* web_ui) | 
|  | 33     : WebUIController(web_ui) { | 
|  | 34   web_ui->AddMessageHandler(new DeviceEmulatorMessageHandler()); | 
|  | 35 | 
|  | 36   Profile* profile = Profile::FromWebUI(web_ui); | 
|  | 37   content::WebUIDataSource::Add(profile, CreateDeviceEmulatorUIDataSource()); | 
|  | 38 } | 
|  | 39 | 
|  | 40 DeviceEmulatorUI::~DeviceEmulatorUI() { | 
|  | 41 } | 
| OLD | NEW | 
|---|