| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 "ios/chrome/browser/ui/webui/physical_web_ui.h" | 5 #include "ios/chrome/browser/ui/webui/physical_web_ui.h" |
| 6 | 6 |
| 7 #include "base/macros.h" | 7 #include "base/macros.h" |
| 8 #include "base/memory/ptr_util.h" |
| 8 #include "base/metrics/user_metrics.h" | 9 #include "base/metrics/user_metrics.h" |
| 9 #include "components/grit/components_resources.h" | 10 #include "components/grit/components_resources.h" |
| 10 #include "components/physical_web/data_source/physical_web_data_source.h" | 11 #include "components/physical_web/data_source/physical_web_data_source.h" |
| 11 #include "components/physical_web/webui/physical_web_base_message_handler.h" | 12 #include "components/physical_web/webui/physical_web_base_message_handler.h" |
| 12 #include "components/physical_web/webui/physical_web_ui_constants.h" | 13 #include "components/physical_web/webui/physical_web_ui_constants.h" |
| 13 #include "components/strings/grit/components_strings.h" | 14 #include "components/strings/grit/components_strings.h" |
| 14 #include "ios/chrome/browser/application_context.h" | 15 #include "ios/chrome/browser/application_context.h" |
| 15 #include "ios/chrome/browser/browser_state/chrome_browser_state.h" | 16 #include "ios/chrome/browser/browser_state/chrome_browser_state.h" |
| 16 #include "ios/chrome/browser/chrome_url_constants.h" | 17 #include "ios/chrome/browser/chrome_url_constants.h" |
| 17 #include "ios/web/public/web_ui_ios_data_source.h" | 18 #include "ios/web/public/web_ui_ios_data_source.h" |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 89 } // namespace | 90 } // namespace |
| 90 | 91 |
| 91 //////////////////////////////////////////////////////////////////////////////// | 92 //////////////////////////////////////////////////////////////////////////////// |
| 92 // | 93 // |
| 93 // PhysicalWebUI | 94 // PhysicalWebUI |
| 94 // | 95 // |
| 95 //////////////////////////////////////////////////////////////////////////////// | 96 //////////////////////////////////////////////////////////////////////////////// |
| 96 | 97 |
| 97 PhysicalWebUI::PhysicalWebUI(web::WebUIIOS* web_ui) | 98 PhysicalWebUI::PhysicalWebUI(web::WebUIIOS* web_ui) |
| 98 : web::WebUIIOSController(web_ui) { | 99 : web::WebUIIOSController(web_ui) { |
| 99 PhysicalWebDOMHandler* handler = new PhysicalWebDOMHandler(); | 100 web_ui->AddMessageHandler(base::MakeUnique<PhysicalWebDOMHandler>()); |
| 100 web_ui->AddMessageHandler(handler); | |
| 101 | 101 |
| 102 web::WebUIIOSDataSource::Add(ios::ChromeBrowserState::FromWebUIIOS(web_ui), | 102 web::WebUIIOSDataSource::Add(ios::ChromeBrowserState::FromWebUIIOS(web_ui), |
| 103 CreatePhysicalWebUIDataSource()); | 103 CreatePhysicalWebUIDataSource()); |
| 104 | 104 |
| 105 base::RecordAction(base::UserMetricsAction("PhysicalWeb.WebUI.Open")); | 105 base::RecordAction(base::UserMetricsAction("PhysicalWeb.WebUI.Open")); |
| 106 } | 106 } |
| 107 | 107 |
| 108 PhysicalWebUI::~PhysicalWebUI() {} | 108 PhysicalWebUI::~PhysicalWebUI() {} |
| OLD | NEW |