| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 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 | 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/popular_sites_internals_ui.h" | 5 #include "chrome/browser/ui/webui/popular_sites_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/popular_sites_internals_message_handler.h" | 8 #include "chrome/browser/ui/webui/popular_sites_internals_message_handler.h" |
| 9 #include "chrome/common/url_constants.h" | 9 #include "chrome/common/url_constants.h" |
| 10 #include "chrome/grit/browser_resources.h" | 10 #include "components/grit/components_resources.h" |
| 11 #include "content/public/browser/web_ui.h" | 11 #include "content/public/browser/web_ui.h" |
| 12 #include "content/public/browser/web_ui_data_source.h" | 12 #include "content/public/browser/web_ui_data_source.h" |
| 13 | 13 |
| 14 content::WebUIDataSource* CreatePopularSitesInternalsHTMLSource() { | 14 content::WebUIDataSource* CreatePopularSitesInternalsHTMLSource() { |
| 15 content::WebUIDataSource* source = content::WebUIDataSource::Create( | 15 content::WebUIDataSource* source = content::WebUIDataSource::Create( |
| 16 chrome::kChromeUIPopularSitesInternalsHost); | 16 chrome::kChromeUIPopularSitesInternalsHost); |
| 17 | 17 |
| 18 source->AddResourcePath("popular_sites_internals.js", | 18 source->AddResourcePath("popular_sites_internals.js", |
| 19 IDR_POPULAR_SITES_INTERNALS_JS); | 19 IDR_POPULAR_SITES_INTERNALS_JS); |
| 20 source->AddResourcePath("popular_sites_internals.css", | 20 source->AddResourcePath("popular_sites_internals.css", |
| 21 IDR_POPULAR_SITES_INTERNALS_CSS); | 21 IDR_POPULAR_SITES_INTERNALS_CSS); |
| 22 source->SetDefaultResource(IDR_POPULAR_SITES_INTERNALS_HTML); | 22 source->SetDefaultResource(IDR_POPULAR_SITES_INTERNALS_HTML); |
| 23 source->DisableI18nAndUseGzipForAllPaths(); | |
| 24 return source; | 23 return source; |
| 25 } | 24 } |
| 26 | 25 |
| 27 PopularSitesInternalsUI::PopularSitesInternalsUI(content::WebUI* web_ui) | 26 PopularSitesInternalsUI::PopularSitesInternalsUI(content::WebUI* web_ui) |
| 28 : WebUIController(web_ui) { | 27 : WebUIController(web_ui) { |
| 29 Profile* profile = Profile::FromWebUI(web_ui); | 28 Profile* profile = Profile::FromWebUI(web_ui); |
| 30 content::WebUIDataSource::Add(profile, | 29 content::WebUIDataSource::Add(profile, |
| 31 CreatePopularSitesInternalsHTMLSource()); | 30 CreatePopularSitesInternalsHTMLSource()); |
| 32 | 31 |
| 33 web_ui->AddMessageHandler(new PopularSitesInternalsMessageHandler); | 32 web_ui->AddMessageHandler(new PopularSitesInternalsMessageHandler); |
| 34 } | 33 } |
| 35 | 34 |
| 36 PopularSitesInternalsUI::~PopularSitesInternalsUI() {} | 35 PopularSitesInternalsUI::~PopularSitesInternalsUI() {} |
| OLD | NEW |