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

Side by Side Diff: chrome/browser/ntp_tiles/chrome_most_visited_sites_factory.cc

Issue 2926023003: Rename SupervisorBridge::whitelists() to GetWhiteLists(). (Closed)
Patch Set: Created 3 years, 6 months 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
« no previous file with comments | « no previous file | components/ntp_tiles/most_visited_sites.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/ntp_tiles/chrome_most_visited_sites_factory.h" 5 #include "chrome/browser/ntp_tiles/chrome_most_visited_sites_factory.h"
6 6
7 #include <utility> 7 #include <utility>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 22 matching lines...) Expand all
33 namespace { 33 namespace {
34 34
35 class SupervisorBridge : public ntp_tiles::MostVisitedSitesSupervisor, 35 class SupervisorBridge : public ntp_tiles::MostVisitedSitesSupervisor,
36 public SupervisedUserServiceObserver { 36 public SupervisedUserServiceObserver {
37 public: 37 public:
38 explicit SupervisorBridge(Profile* profile); 38 explicit SupervisorBridge(Profile* profile);
39 ~SupervisorBridge() override; 39 ~SupervisorBridge() override;
40 40
41 void SetObserver(Observer* observer) override; 41 void SetObserver(Observer* observer) override;
42 bool IsBlocked(const GURL& url) override; 42 bool IsBlocked(const GURL& url) override;
43 std::vector<MostVisitedSitesSupervisor::Whitelist> whitelists() override; 43 std::vector<MostVisitedSitesSupervisor::Whitelist> GetWhitelists() override;
44 bool IsChildProfile() override; 44 bool IsChildProfile() override;
45 45
46 // SupervisedUserServiceObserver implementation. 46 // SupervisedUserServiceObserver implementation.
47 void OnURLFilterChanged() override; 47 void OnURLFilterChanged() override;
48 48
49 private: 49 private:
50 Profile* const profile_; 50 Profile* const profile_;
51 Observer* supervisor_observer_; 51 Observer* supervisor_observer_;
52 ScopedObserver<SupervisedUserService, SupervisedUserServiceObserver> 52 ScopedObserver<SupervisedUserService, SupervisedUserServiceObserver>
53 register_observer_; 53 register_observer_;
(...skipping 20 matching lines...) Expand all
74 74
75 bool SupervisorBridge::IsBlocked(const GURL& url) { 75 bool SupervisorBridge::IsBlocked(const GURL& url) {
76 SupervisedUserService* supervised_user_service = 76 SupervisedUserService* supervised_user_service =
77 SupervisedUserServiceFactory::GetForProfile(profile_); 77 SupervisedUserServiceFactory::GetForProfile(profile_);
78 auto* url_filter = supervised_user_service->GetURLFilter(); 78 auto* url_filter = supervised_user_service->GetURLFilter();
79 return url_filter->GetFilteringBehaviorForURL(url) == 79 return url_filter->GetFilteringBehaviorForURL(url) ==
80 SupervisedUserURLFilter::FilteringBehavior::BLOCK; 80 SupervisedUserURLFilter::FilteringBehavior::BLOCK;
81 } 81 }
82 82
83 std::vector<ntp_tiles::MostVisitedSitesSupervisor::Whitelist> 83 std::vector<ntp_tiles::MostVisitedSitesSupervisor::Whitelist>
84 SupervisorBridge::whitelists() { 84 SupervisorBridge::GetWhitelists() {
85 std::vector<MostVisitedSitesSupervisor::Whitelist> results; 85 std::vector<MostVisitedSitesSupervisor::Whitelist> results;
86 SupervisedUserService* supervised_user_service = 86 SupervisedUserService* supervised_user_service =
87 SupervisedUserServiceFactory::GetForProfile(profile_); 87 SupervisedUserServiceFactory::GetForProfile(profile_);
88 for (const auto& whitelist : supervised_user_service->whitelists()) { 88 for (const auto& whitelist : supervised_user_service->whitelists()) {
89 results.emplace_back(Whitelist{ 89 results.emplace_back(Whitelist{
90 whitelist->title(), whitelist->entry_point(), 90 whitelist->title(), whitelist->entry_point(),
91 whitelist->large_icon_path(), 91 whitelist->large_icon_path(),
92 }); 92 });
93 } 93 }
94 return results; 94 return results;
(...skipping 29 matching lines...) Expand all
124 #endif 124 #endif
125 base::MakeUnique<ntp_tiles::IconCacherImpl>( 125 base::MakeUnique<ntp_tiles::IconCacherImpl>(
126 FaviconServiceFactory::GetForProfile( 126 FaviconServiceFactory::GetForProfile(
127 profile, ServiceAccessType::IMPLICIT_ACCESS), 127 profile, ServiceAccessType::IMPLICIT_ACCESS),
128 LargeIconServiceFactory::GetForBrowserContext(profile), 128 LargeIconServiceFactory::GetForBrowserContext(profile),
129 base::MakeUnique<image_fetcher::ImageFetcherImpl>( 129 base::MakeUnique<image_fetcher::ImageFetcherImpl>(
130 base::MakeUnique<suggestions::ImageDecoderImpl>(), 130 base::MakeUnique<suggestions::ImageDecoderImpl>(),
131 profile->GetRequestContext())), 131 profile->GetRequestContext())),
132 base::MakeUnique<SupervisorBridge>(profile)); 132 base::MakeUnique<SupervisorBridge>(profile));
133 } 133 }
OLDNEW
« no previous file with comments | « no previous file | components/ntp_tiles/most_visited_sites.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698