OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_MANAGED_MODE_MANAGED_MODE_NAVIGATION_OBSERVER_H_ | 5 #ifndef CHROME_BROWSER_MANAGED_MODE_MANAGED_MODE_NAVIGATION_OBSERVER_H_ |
6 #define CHROME_BROWSER_MANAGED_MODE_MANAGED_MODE_NAVIGATION_OBSERVER_H_ | 6 #define CHROME_BROWSER_MANAGED_MODE_MANAGED_MODE_NAVIGATION_OBSERVER_H_ |
7 | 7 |
8 #include <set> | 8 #include <set> |
9 | 9 |
10 #include "base/values.h" | 10 #include "base/values.h" |
11 #include "content/public/browser/web_contents_observer.h" | 11 #include "content/public/browser/web_contents_observer.h" |
12 #include "content/public/browser/web_contents_user_data.h" | 12 #include "content/public/browser/web_contents_user_data.h" |
13 | 13 |
14 class InfoBarDelegate; | 14 class InfoBarDelegate; |
15 class ManagedModeURLFilter; | 15 class ManagedModeURLFilter; |
| 16 class ManagedUserService; |
16 | 17 |
17 class ManagedModeNavigationObserver | 18 class ManagedModeNavigationObserver |
18 : public content::WebContentsObserver, | 19 : public content::WebContentsObserver, |
19 public content::WebContentsUserData<ManagedModeNavigationObserver> { | 20 public content::WebContentsUserData<ManagedModeNavigationObserver> { |
20 public: | 21 public: |
21 virtual ~ManagedModeNavigationObserver(); | 22 virtual ~ManagedModeNavigationObserver(); |
22 | 23 |
23 // Sets the specific infobar as dismissed. | 24 // Sets the specific infobar as dismissed. |
24 void WarnInfobarDismissed(); | 25 void WarnInfobarDismissed(); |
25 void PreviewInfobarDismissed(); | 26 void PreviewInfobarDismissed(); |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
99 virtual void ProvisionalChangeToMainFrameUrl( | 100 virtual void ProvisionalChangeToMainFrameUrl( |
100 const GURL& url, | 101 const GURL& url, |
101 content::RenderViewHost* render_view_host) OVERRIDE; | 102 content::RenderViewHost* render_view_host) OVERRIDE; |
102 virtual void DidCommitProvisionalLoadForFrame( | 103 virtual void DidCommitProvisionalLoadForFrame( |
103 int64 frame_id, | 104 int64 frame_id, |
104 bool is_main_frame, | 105 bool is_main_frame, |
105 const GURL& url, | 106 const GURL& url, |
106 content::PageTransition transition_type, | 107 content::PageTransition transition_type, |
107 content::RenderViewHost* render_view_host) OVERRIDE; | 108 content::RenderViewHost* render_view_host) OVERRIDE; |
108 | 109 |
109 // Owned by ManagedMode (which is a singleton and outlives us). | 110 // Owned by the profile, so outlives us. |
| 111 ManagedUserService* managed_user_service_; |
| 112 |
| 113 // Owned by ManagedUserService. |
110 const ManagedModeURLFilter* url_filter_; | 114 const ManagedModeURLFilter* url_filter_; |
111 | 115 |
112 // Owned by the InfoBarService, which has the same lifetime as this object. | 116 // Owned by the InfoBarService, which has the same lifetime as this object. |
113 InfoBarDelegate* warn_infobar_delegate_; | 117 InfoBarDelegate* warn_infobar_delegate_; |
114 InfoBarDelegate* preview_infobar_delegate_; | 118 InfoBarDelegate* preview_infobar_delegate_; |
115 | 119 |
116 ObserverState state_; | 120 ObserverState state_; |
117 std::set<GURL> navigated_urls_; | 121 std::set<GURL> navigated_urls_; |
118 GURL last_url_; | 122 GURL last_url_; |
119 | 123 |
120 int last_allowed_page_; | 124 int last_allowed_page_; |
121 | 125 |
122 DISALLOW_COPY_AND_ASSIGN(ManagedModeNavigationObserver); | 126 DISALLOW_COPY_AND_ASSIGN(ManagedModeNavigationObserver); |
123 }; | 127 }; |
124 | 128 |
125 #endif // CHROME_BROWSER_MANAGED_MODE_MANAGED_MODE_NAVIGATION_OBSERVER_H_ | 129 #endif // CHROME_BROWSER_MANAGED_MODE_MANAGED_MODE_NAVIGATION_OBSERVER_H_ |
OLD | NEW |