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_UI_ALTERNATE_ERROR_TAB_OBSERVER_H_ | 5 #ifndef CHROME_BROWSER_UI_ALTERNATE_ERROR_TAB_OBSERVER_H_ |
6 #define CHROME_BROWSER_UI_ALTERNATE_ERROR_TAB_OBSERVER_H_ | 6 #define CHROME_BROWSER_UI_ALTERNATE_ERROR_TAB_OBSERVER_H_ |
7 | 7 |
8 #include "base/prefs/public/pref_change_registrar.h" | 8 #include "base/prefs/public/pref_change_registrar.h" |
9 #include "chrome/browser/prefs/pref_service.h" | 9 #include "chrome/browser/prefs/pref_service.h" |
10 #include "content/public/browser/notification_observer.h" | 10 #include "content/public/browser/notification_observer.h" |
11 #include "content/public/browser/notification_registrar.h" | 11 #include "content/public/browser/notification_registrar.h" |
12 #include "content/public/browser/web_contents_observer.h" | 12 #include "content/public/browser/web_contents_observer.h" |
13 #include "content/public/browser/web_contents_user_data.h" | 13 #include "content/public/browser/web_contents_user_data.h" |
14 | 14 |
15 class Profile; | 15 class Profile; |
16 | 16 |
17 // Per-tab class to implement alternate error page functionality. | 17 // Per-tab class to implement alternate error page functionality. |
18 class AlternateErrorPageTabObserver | 18 class AlternateErrorPageTabObserver |
19 : public content::WebContentsObserver, | 19 : public content::WebContentsObserver, |
20 public content::NotificationObserver, | 20 public content::NotificationObserver, |
21 public content::WebContentsUserData<AlternateErrorPageTabObserver> { | 21 public content::WebContentsUserData<AlternateErrorPageTabObserver> { |
22 public: | 22 public: |
23 virtual ~AlternateErrorPageTabObserver(); | 23 virtual ~AlternateErrorPageTabObserver(); |
24 | 24 |
25 static void RegisterUserPrefs(PrefService* prefs); | 25 static void RegisterUserPrefs(PrefServiceSyncable* prefs); |
26 | 26 |
27 private: | 27 private: |
28 explicit AlternateErrorPageTabObserver(content::WebContents* web_contents); | 28 explicit AlternateErrorPageTabObserver(content::WebContents* web_contents); |
29 friend class content::WebContentsUserData<AlternateErrorPageTabObserver>; | 29 friend class content::WebContentsUserData<AlternateErrorPageTabObserver>; |
30 | 30 |
31 // content::WebContentsObserver overrides: | 31 // content::WebContentsObserver overrides: |
32 virtual void RenderViewCreated( | 32 virtual void RenderViewCreated( |
33 content::RenderViewHost* render_view_host) OVERRIDE; | 33 content::RenderViewHost* render_view_host) OVERRIDE; |
34 | 34 |
35 // content::NotificationObserver overrides: | 35 // content::NotificationObserver overrides: |
(...skipping 13 matching lines...) Expand all Loading... |
49 void UpdateAlternateErrorPageURL(content::RenderViewHost* rvh); | 49 void UpdateAlternateErrorPageURL(content::RenderViewHost* rvh); |
50 | 50 |
51 Profile* profile_; | 51 Profile* profile_; |
52 content::NotificationRegistrar registrar_; | 52 content::NotificationRegistrar registrar_; |
53 PrefChangeRegistrar pref_change_registrar_; | 53 PrefChangeRegistrar pref_change_registrar_; |
54 | 54 |
55 DISALLOW_COPY_AND_ASSIGN(AlternateErrorPageTabObserver); | 55 DISALLOW_COPY_AND_ASSIGN(AlternateErrorPageTabObserver); |
56 }; | 56 }; |
57 | 57 |
58 #endif // CHROME_BROWSER_UI_ALTERNATE_ERROR_TAB_OBSERVER_H_ | 58 #endif // CHROME_BROWSER_UI_ALTERNATE_ERROR_TAB_OBSERVER_H_ |
OLD | NEW |