| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 #ifndef CHROME_BROWSER_ANDROID_NTP_MOST_VISITED_SITES_BRIDGE_H_ | 5 #ifndef CHROME_BROWSER_ANDROID_NTP_MOST_VISITED_SITES_BRIDGE_H_ |
| 6 #define CHROME_BROWSER_ANDROID_NTP_MOST_VISITED_SITES_BRIDGE_H_ | 6 #define CHROME_BROWSER_ANDROID_NTP_MOST_VISITED_SITES_BRIDGE_H_ |
| 7 | 7 |
| 8 #include <jni.h> | 8 #include <jni.h> |
| 9 #include <stddef.h> | 9 #include <stddef.h> |
| 10 | 10 |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 55 | 55 |
| 56 // Registers JNI methods. | 56 // Registers JNI methods. |
| 57 static bool Register(JNIEnv* env); | 57 static bool Register(JNIEnv* env); |
| 58 | 58 |
| 59 private: | 59 private: |
| 60 ~MostVisitedSitesBridge(); | 60 ~MostVisitedSitesBridge(); |
| 61 | 61 |
| 62 class JavaObserver; | 62 class JavaObserver; |
| 63 std::unique_ptr<JavaObserver> java_observer_; | 63 std::unique_ptr<JavaObserver> java_observer_; |
| 64 | 64 |
| 65 class SupervisorBridge : public MostVisitedSitesSupervisor, | 65 class SupervisorBridge : public ntp_tiles::MostVisitedSitesSupervisor, |
| 66 public SupervisedUserServiceObserver { | 66 public SupervisedUserServiceObserver { |
| 67 public: | 67 public: |
| 68 explicit SupervisorBridge(Profile* profile); | 68 explicit SupervisorBridge(Profile* profile); |
| 69 ~SupervisorBridge() override; | 69 ~SupervisorBridge() override; |
| 70 | 70 |
| 71 void SetObserver(Observer* observer) override; | 71 void SetObserver(Observer* observer) override; |
| 72 bool IsBlocked(const GURL& url) override; | 72 bool IsBlocked(const GURL& url) override; |
| 73 std::vector<MostVisitedSitesSupervisor::Whitelist> whitelists() override; | 73 std::vector<MostVisitedSitesSupervisor::Whitelist> whitelists() override; |
| 74 bool IsChildProfile() override; | 74 bool IsChildProfile() override; |
| 75 | 75 |
| 76 // SupervisedUserServiceObserver implementation. | 76 // SupervisedUserServiceObserver implementation. |
| 77 void OnURLFilterChanged() override; | 77 void OnURLFilterChanged() override; |
| 78 | 78 |
| 79 private: | 79 private: |
| 80 Profile* const profile_; | 80 Profile* const profile_; |
| 81 Observer* supervisor_observer_; | 81 Observer* supervisor_observer_; |
| 82 ScopedObserver<SupervisedUserService, SupervisedUserServiceObserver> | 82 ScopedObserver<SupervisedUserService, SupervisedUserServiceObserver> |
| 83 register_observer_; | 83 register_observer_; |
| 84 }; | 84 }; |
| 85 SupervisorBridge supervisor_; | 85 SupervisorBridge supervisor_; |
| 86 | 86 |
| 87 MostVisitedSites most_visited_; | 87 ntp_tiles::MostVisitedSites most_visited_; |
| 88 | 88 |
| 89 DISALLOW_COPY_AND_ASSIGN(MostVisitedSitesBridge); | 89 DISALLOW_COPY_AND_ASSIGN(MostVisitedSitesBridge); |
| 90 }; | 90 }; |
| 91 | 91 |
| 92 #endif // CHROME_BROWSER_ANDROID_NTP_MOST_VISITED_SITES_BRIDGE_H_ | 92 #endif // CHROME_BROWSER_ANDROID_NTP_MOST_VISITED_SITES_BRIDGE_H_ |
| OLD | NEW |