Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(859)

Side by Side Diff: chrome/browser/ui/webui/popular_sites_internals_ui.cc

Issue 2570783003: [Popular Sites] Split PopularSites interface and PopularSitesImpl (Closed)
Patch Set: Split PopularSitesImpl. Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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/android/ntp/popular_sites.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"
(...skipping 13 matching lines...) Expand all
24 public ntp_tiles::PopularSitesInternalsMessageHandlerClient { 24 public ntp_tiles::PopularSitesInternalsMessageHandlerClient {
25 public: 25 public:
26 ChromePopularSitesInternalsMessageHandlerBridge() : handler_(this) {} 26 ChromePopularSitesInternalsMessageHandlerBridge() : handler_(this) {}
27 27
28 private: 28 private:
29 // content::WebUIMessageHandler: 29 // content::WebUIMessageHandler:
30 void RegisterMessages() override; 30 void RegisterMessages() override;
31 31
32 // ntp_tiles::PopularSitesInternalsMessageHandlerClient 32 // ntp_tiles::PopularSitesInternalsMessageHandlerClient
33 base::SequencedWorkerPool* GetBlockingPool() override; 33 base::SequencedWorkerPool* GetBlockingPool() override;
34 std::unique_ptr<ntp_tiles::PopularSites> MakePopularSites() override; 34 std::unique_ptr<ntp_tiles::PopularSitesImpl> MakePopularSites() override;
35 PrefService* GetPrefs() override; 35 PrefService* GetPrefs() override;
36 void RegisterMessageCallback( 36 void RegisterMessageCallback(
37 const std::string& message, 37 const std::string& message,
38 const base::Callback<void(const base::ListValue*)>& callback) override; 38 const base::Callback<void(const base::ListValue*)>& callback) override;
39 void CallJavascriptFunctionVector( 39 void CallJavascriptFunctionVector(
40 const std::string& name, 40 const std::string& name,
41 const std::vector<const base::Value*>& values) override; 41 const std::vector<const base::Value*>& values) override;
42 42
43 ntp_tiles::PopularSitesInternalsMessageHandler handler_; 43 ntp_tiles::PopularSitesInternalsMessageHandler handler_;
44 44
45 DISALLOW_COPY_AND_ASSIGN(ChromePopularSitesInternalsMessageHandlerBridge); 45 DISALLOW_COPY_AND_ASSIGN(ChromePopularSitesInternalsMessageHandlerBridge);
46 }; 46 };
47 47
48 void ChromePopularSitesInternalsMessageHandlerBridge::RegisterMessages() { 48 void ChromePopularSitesInternalsMessageHandlerBridge::RegisterMessages() {
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::PopularSitesImpl>
58 ChromePopularSitesInternalsMessageHandlerBridge::MakePopularSites() { 58 ChromePopularSitesInternalsMessageHandlerBridge::MakePopularSites() {
59 return ChromePopularSites::NewForProfile(Profile::FromWebUI(web_ui())); 59 return ChromePopularSites::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,
(...skipping 24 matching lines...) Expand all
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() {}
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698