OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/suggestions_internals/suggestions_internals_ui
.h" | 5 #include "chrome/browser/ui/webui/suggestions_internals/suggestions_internals_ui
.h" |
6 | 6 |
7 #include "chrome/browser/profiles/profile.h" | 7 #include "chrome/browser/profiles/profile.h" |
8 #include "chrome/browser/ui/webui/chrome_web_ui_data_source.h" | 8 #include "chrome/browser/ui/webui/chrome_web_ui_data_source.h" |
9 #include "chrome/browser/ui/webui/favicon_source.h" | 9 #include "chrome/browser/ui/webui/favicon_source.h" |
10 #include "chrome/browser/ui/webui/suggestions_internals/suggestions_internals_ui
_handler.h" | 10 #include "chrome/browser/ui/webui/suggestions_internals/suggestions_internals_ui
_handler.h" |
11 #include "chrome/common/url_constants.h" | 11 #include "chrome/common/url_constants.h" |
12 #include "content/public/browser/web_ui.h" | 12 #include "content/public/browser/web_ui.h" |
13 #include "content/public/browser/web_ui_controller.h" | 13 #include "content/public/browser/web_ui_controller.h" |
14 #include "grit/browser_resources.h" | 14 #include "grit/browser_resources.h" |
15 | 15 |
16 SuggestionsInternalsUI::SuggestionsInternalsUI(content::WebUI* web_ui) | 16 SuggestionsInternalsUI::SuggestionsInternalsUI(content::WebUI* web_ui) |
17 : content::WebUIController(web_ui) { | 17 : content::WebUIController(web_ui) { |
18 // Set up the chrome://suggestions-internals/ source. | 18 // Set up the chrome://suggestions-internals/ source. |
19 ChromeWebUIDataSource* html_source = | 19 ChromeWebUIDataSource* html_source = |
20 new ChromeWebUIDataSource(chrome::kChromeUISuggestionsInternalsHost); | 20 new ChromeWebUIDataSource(chrome::kChromeUISuggestionsInternalsHost); |
21 html_source->add_resource_path("suggestions_internals.css", | 21 html_source->add_resource_path("suggestions_internals.css", |
22 IDR_SUGGESTIONS_INTERNALS_CSS); | 22 IDR_SUGGESTIONS_INTERNALS_CSS); |
23 html_source->add_resource_path("suggestions_internals.js", | 23 html_source->add_resource_path("suggestions_internals.js", |
24 IDR_SUGGESTIONS_INTERNALS_JS); | 24 IDR_SUGGESTIONS_INTERNALS_JS); |
25 html_source->set_default_resource(IDR_SUGGESTIONS_INTERNALS_HTML); | 25 html_source->set_default_resource(IDR_SUGGESTIONS_INTERNALS_HTML); |
26 | 26 |
27 Profile* profile = Profile::FromWebUI(web_ui); | 27 Profile* profile = Profile::FromWebUI(web_ui); |
28 ChromeURLDataManager::AddDataSource(profile, html_source); | 28 ChromeURLDataManager::AddDataSourceImpl(profile, html_source); |
29 ChromeURLDataManager::AddDataSource(profile, | 29 ChromeURLDataManager::AddDataSource( |
30 new FaviconSource(profile, FaviconSource::FAVICON)); | 30 profile, new FaviconSource(profile, FaviconSource::FAVICON)); |
31 | 31 |
32 // AddMessageHandler takes ownership of SuggestionsInternalsUIHandler | 32 // AddMessageHandler takes ownership of SuggestionsInternalsUIHandler |
33 web_ui->AddMessageHandler(new SuggestionsInternalsUIHandler(profile)); | 33 web_ui->AddMessageHandler(new SuggestionsInternalsUIHandler(profile)); |
34 } | 34 } |
35 | 35 |
36 SuggestionsInternalsUI::~SuggestionsInternalsUI() { } | 36 SuggestionsInternalsUI::~SuggestionsInternalsUI() { } |
OLD | NEW |