| 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/android/ntp/popular_sites.h" | 7 #include "chrome/browser/ntp_tiles/chrome_popular_sites_factory.h" |
| 8 #include "chrome/browser/profiles/profile.h" | 8 #include "chrome/browser/profiles/profile.h" |
| 9 #include "chrome/common/url_constants.h" | 9 #include "chrome/common/url_constants.h" |
| 10 #include "components/grit/components_resources.h" | 10 #include "components/grit/components_resources.h" |
| 11 #include "components/ntp_tiles/popular_sites.h" | 11 #include "components/ntp_tiles/popular_sites.h" |
| 12 #include "components/ntp_tiles/webui/popular_sites_internals_message_handler.h" | 12 #include "components/ntp_tiles/webui/popular_sites_internals_message_handler.h" |
| 13 #include "components/ntp_tiles/webui/popular_sites_internals_message_handler_cli
ent.h" | 13 #include "components/ntp_tiles/webui/popular_sites_internals_message_handler_cli
ent.h" |
| 14 #include "content/public/browser/browser_thread.h" | 14 #include "content/public/browser/browser_thread.h" |
| 15 #include "content/public/browser/web_ui.h" | 15 #include "content/public/browser/web_ui.h" |
| 16 #include "content/public/browser/web_ui_data_source.h" | 16 #include "content/public/browser/web_ui_data_source.h" |
| 17 #include "content/public/browser/web_ui_message_handler.h" | 17 #include "content/public/browser/web_ui_message_handler.h" |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 49 handler_.RegisterMessages(); | 49 handler_.RegisterMessages(); |
| 50 } | 50 } |
| 51 | 51 |
| 52 base::SequencedWorkerPool* | 52 base::SequencedWorkerPool* |
| 53 ChromePopularSitesInternalsMessageHandlerBridge::GetBlockingPool() { | 53 ChromePopularSitesInternalsMessageHandlerBridge::GetBlockingPool() { |
| 54 return content::BrowserThread::GetBlockingPool(); | 54 return content::BrowserThread::GetBlockingPool(); |
| 55 } | 55 } |
| 56 | 56 |
| 57 std::unique_ptr<ntp_tiles::PopularSites> | 57 std::unique_ptr<ntp_tiles::PopularSites> |
| 58 ChromePopularSitesInternalsMessageHandlerBridge::MakePopularSites() { | 58 ChromePopularSitesInternalsMessageHandlerBridge::MakePopularSites() { |
| 59 return ChromePopularSites::NewForProfile(Profile::FromWebUI(web_ui())); | 59 return ChromePopularSitesFactory::NewForProfile(Profile::FromWebUI(web_ui())); |
| 60 } | 60 } |
| 61 | 61 |
| 62 PrefService* ChromePopularSitesInternalsMessageHandlerBridge::GetPrefs() { | 62 PrefService* ChromePopularSitesInternalsMessageHandlerBridge::GetPrefs() { |
| 63 return Profile::FromWebUI(web_ui())->GetPrefs(); | 63 return Profile::FromWebUI(web_ui())->GetPrefs(); |
| 64 } | 64 } |
| 65 | 65 |
| 66 void ChromePopularSitesInternalsMessageHandlerBridge::RegisterMessageCallback( | 66 void ChromePopularSitesInternalsMessageHandlerBridge::RegisterMessageCallback( |
| 67 const std::string& message, | 67 const std::string& message, |
| 68 const base::Callback<void(const base::ListValue*)>& callback) { | 68 const base::Callback<void(const base::ListValue*)>& callback) { |
| 69 web_ui()->RegisterMessageCallback(message, callback); | 69 web_ui()->RegisterMessageCallback(message, callback); |
| (...skipping 22 matching lines...) Expand all Loading... |
| 92 | 92 |
| 93 PopularSitesInternalsUI::PopularSitesInternalsUI(content::WebUI* web_ui) | 93 PopularSitesInternalsUI::PopularSitesInternalsUI(content::WebUI* web_ui) |
| 94 : WebUIController(web_ui) { | 94 : WebUIController(web_ui) { |
| 95 content::WebUIDataSource::Add(Profile::FromWebUI(web_ui), | 95 content::WebUIDataSource::Add(Profile::FromWebUI(web_ui), |
| 96 CreatePopularSitesInternalsHTMLSource()); | 96 CreatePopularSitesInternalsHTMLSource()); |
| 97 web_ui->AddMessageHandler( | 97 web_ui->AddMessageHandler( |
| 98 new ChromePopularSitesInternalsMessageHandlerBridge); | 98 new ChromePopularSitesInternalsMessageHandlerBridge); |
| 99 } | 99 } |
| 100 | 100 |
| 101 PopularSitesInternalsUI::~PopularSitesInternalsUI() {} | 101 PopularSitesInternalsUI::~PopularSitesInternalsUI() {} |
| OLD | NEW |