OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_SUPERVISED_USER_SUPERVISED_USER_NAVIGATION_OBSERVER_H_ | 5 #ifndef CHROME_BROWSER_SUPERVISED_USER_SUPERVISED_USER_NAVIGATION_OBSERVER_H_ |
6 #define CHROME_BROWSER_SUPERVISED_USER_SUPERVISED_USER_NAVIGATION_OBSERVER_H_ | 6 #define CHROME_BROWSER_SUPERVISED_USER_SUPERVISED_USER_NAVIGATION_OBSERVER_H_ |
7 | 7 |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/memory/scoped_vector.h" | 10 #include "base/memory/scoped_vector.h" |
11 #include "chrome/browser/supervised_user/supervised_user_service_observer.h" | 11 #include "chrome/browser/supervised_user/supervised_user_service_observer.h" |
12 #include "chrome/browser/supervised_user/supervised_user_url_filter.h" | 12 #include "chrome/browser/supervised_user/supervised_user_url_filter.h" |
13 #include "chrome/browser/supervised_user/supervised_users.h" | 13 #include "chrome/browser/supervised_user/supervised_users.h" |
| 14 #include "components/sessions/core/serialized_navigation_entry.h" |
14 #include "content/public/browser/web_contents_user_data.h" | 15 #include "content/public/browser/web_contents_user_data.h" |
15 | 16 |
16 class SupervisedUserService; | 17 class SupervisedUserService; |
17 | 18 |
18 namespace content { | 19 namespace content { |
19 class NavigationEntry; | 20 class NavigationEntry; |
20 class WebContents; | 21 class WebContents; |
21 } | 22 } |
22 | 23 |
23 class SupervisedUserNavigationObserver | 24 class SupervisedUserNavigationObserver |
24 : public content::WebContentsUserData<SupervisedUserNavigationObserver>, | 25 : public content::WebContentsUserData<SupervisedUserNavigationObserver>, |
25 public SupervisedUserServiceObserver { | 26 public SupervisedUserServiceObserver { |
26 public: | 27 public: |
27 ~SupervisedUserNavigationObserver() override; | 28 ~SupervisedUserNavigationObserver() override; |
28 | 29 |
29 const std::vector<const content::NavigationEntry*>* | 30 const std::vector<const sessions::SerializedNavigationEntry*>* |
30 blocked_navigations() const { | 31 blocked_navigations() const { |
31 return &blocked_navigations_.get(); | 32 return &blocked_navigations_.get(); |
32 } | 33 } |
33 | 34 |
34 // Called when a network request to |url| is blocked. | 35 // Called when a network request to |url| is blocked. |
35 static void OnRequestBlocked( | 36 static void OnRequestBlocked( |
36 int render_process_host_id, | 37 int render_process_host_id, |
37 int render_view_id, | 38 int render_view_id, |
38 const GURL& url, | 39 const GURL& url, |
39 SupervisedUserURLFilter::FilteringBehaviorReason reason, | 40 SupervisedUserURLFilter::FilteringBehaviorReason reason, |
40 const base::Callback<void(bool)>& callback); | 41 const base::Callback<void(bool)>& callback); |
(...skipping 15 matching lines...) Expand all Loading... |
56 void OnRequestBlockedInternal(const GURL& url); | 57 void OnRequestBlockedInternal(const GURL& url); |
57 | 58 |
58 content::WebContents* web_contents_; | 59 content::WebContents* web_contents_; |
59 | 60 |
60 // Owned by SupervisedUserService. | 61 // Owned by SupervisedUserService. |
61 const SupervisedUserURLFilter* url_filter_; | 62 const SupervisedUserURLFilter* url_filter_; |
62 | 63 |
63 // Owned by SupervisedUserServiceFactory (lifetime of Profile). | 64 // Owned by SupervisedUserServiceFactory (lifetime of Profile). |
64 SupervisedUserService* supervised_user_service_; | 65 SupervisedUserService* supervised_user_service_; |
65 | 66 |
66 ScopedVector<const content::NavigationEntry> blocked_navigations_; | 67 ScopedVector<const sessions::SerializedNavigationEntry> blocked_navigations_; |
67 | 68 |
68 base::WeakPtrFactory<SupervisedUserNavigationObserver> weak_ptr_factory_; | 69 base::WeakPtrFactory<SupervisedUserNavigationObserver> weak_ptr_factory_; |
69 | 70 |
70 DISALLOW_COPY_AND_ASSIGN(SupervisedUserNavigationObserver); | 71 DISALLOW_COPY_AND_ASSIGN(SupervisedUserNavigationObserver); |
71 }; | 72 }; |
72 | 73 |
73 #endif // CHROME_BROWSER_SUPERVISED_USER_SUPERVISED_USER_NAVIGATION_OBSERVER_H_ | 74 #endif // CHROME_BROWSER_SUPERVISED_USER_SUPERVISED_USER_NAVIGATION_OBSERVER_H_ |
OLD | NEW |