OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/local_discovery/local_discovery_ui.h" | 5 #include "chrome/browser/ui/webui/local_discovery/local_discovery_ui.h" |
6 | 6 |
7 #include "chrome/browser/profiles/profile.h" | 7 #include "chrome/browser/profiles/profile.h" |
8 #include "chrome/browser/ui/webui/local_discovery/local_discovery_ui_handler.h" | 8 #include "chrome/browser/ui/webui/local_discovery/local_discovery_ui_handler.h" |
| 9 #include "chrome/browser/ui/webui/metrics_handler.h" |
9 #include "chrome/common/url_constants.h" | 10 #include "chrome/common/url_constants.h" |
10 #include "content/public/browser/web_ui.h" | 11 #include "content/public/browser/web_ui.h" |
11 #include "content/public/browser/web_ui_data_source.h" | 12 #include "content/public/browser/web_ui_data_source.h" |
12 #include "grit/browser_resources.h" | 13 #include "grit/browser_resources.h" |
13 #include "grit/generated_resources.h" | 14 #include "grit/generated_resources.h" |
14 | 15 |
15 namespace { | 16 namespace { |
16 | 17 |
17 content::WebUIDataSource* CreateLocalDiscoveryHTMLSource() { | 18 content::WebUIDataSource* CreateLocalDiscoveryHTMLSource() { |
18 content::WebUIDataSource* source = | 19 content::WebUIDataSource* source = |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
76 | 77 |
77 LocalDiscoveryUI::LocalDiscoveryUI(content::WebUI* web_ui) | 78 LocalDiscoveryUI::LocalDiscoveryUI(content::WebUI* web_ui) |
78 : WebUIController(web_ui) { | 79 : WebUIController(web_ui) { |
79 // Set up the chrome://devices/ source. | 80 // Set up the chrome://devices/ source. |
80 Profile* profile = Profile::FromWebUI(web_ui); | 81 Profile* profile = Profile::FromWebUI(web_ui); |
81 content::WebUIDataSource::Add(profile, CreateLocalDiscoveryHTMLSource()); | 82 content::WebUIDataSource::Add(profile, CreateLocalDiscoveryHTMLSource()); |
82 | 83 |
83 // TODO(gene): Use LocalDiscoveryUIHandler to send updated to the devices | 84 // TODO(gene): Use LocalDiscoveryUIHandler to send updated to the devices |
84 // page. For example | 85 // page. For example |
85 web_ui->AddMessageHandler(local_discovery::LocalDiscoveryUIHandler::Create()); | 86 web_ui->AddMessageHandler(local_discovery::LocalDiscoveryUIHandler::Create()); |
| 87 web_ui->AddMessageHandler(new MetricsHandler()); |
86 } | 88 } |
OLD | NEW |