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

Side by Side Diff: chrome/browser/safe_browsing/safe_browsing_tab_observer.h

Issue 11414083: Remove PrefObserver usage, batch 9. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Merge to sort-of good revision (r169014). Created 8 years, 1 month 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 | Annotate | Revision Log
OLDNEW
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_SAFE_BROWSING_SAFE_BROWSING_TAB_OBSERVER_H_ 5 #ifndef CHROME_BROWSER_SAFE_BROWSING_SAFE_BROWSING_TAB_OBSERVER_H_
6 #define CHROME_BROWSER_SAFE_BROWSING_SAFE_BROWSING_TAB_OBSERVER_H_ 6 #define CHROME_BROWSER_SAFE_BROWSING_SAFE_BROWSING_TAB_OBSERVER_H_
7 7
8 #include "base/memory/scoped_ptr.h" 8 #include "base/memory/scoped_ptr.h"
9 #include "base/prefs/public/pref_change_registrar.h" 9 #include "base/prefs/public/pref_change_registrar.h"
10 #include "base/prefs/public/pref_observer.h"
11 #include "content/public/browser/web_contents_user_data.h" 10 #include "content/public/browser/web_contents_user_data.h"
12 11
13 namespace content { 12 namespace content {
14 class WebContents; 13 class WebContents;
15 } 14 }
16 15
17 namespace safe_browsing { 16 namespace safe_browsing {
18 17
19 class ClientSideDetectionHost; 18 class ClientSideDetectionHost;
20 19
21 // Per-tab class to handle safe-browsing functionality. 20 // Per-tab class to handle safe-browsing functionality.
22 class SafeBrowsingTabObserver 21 class SafeBrowsingTabObserver
23 : public PrefObserver, 22 : public content::WebContentsUserData<SafeBrowsingTabObserver> {
24 public content::WebContentsUserData<SafeBrowsingTabObserver> {
25 public: 23 public:
26 virtual ~SafeBrowsingTabObserver(); 24 virtual ~SafeBrowsingTabObserver();
27 25
28 private: 26 private:
29 explicit SafeBrowsingTabObserver(content::WebContents* web_contents); 27 explicit SafeBrowsingTabObserver(content::WebContents* web_contents);
30 friend class content::WebContentsUserData<SafeBrowsingTabObserver>; 28 friend class content::WebContentsUserData<SafeBrowsingTabObserver>;
31 29
32 // PrefObserver overrides:
33 virtual void OnPreferenceChanged(PrefServiceBase* service,
34 const std::string& pref_name) OVERRIDE;
35
36 // Internal helpers ---------------------------------------------------------- 30 // Internal helpers ----------------------------------------------------------
37 31
38 // Create or destroy SafebrowsingDetectionHost as needed if the user's 32 // Create or destroy SafebrowsingDetectionHost as needed if the user's
39 // safe browsing preference has changed. 33 // safe browsing preference has changed.
40 void UpdateSafebrowsingDetectionHost(); 34 void UpdateSafebrowsingDetectionHost();
41 35
42 // Handles IPCs. 36 // Handles IPCs.
43 scoped_ptr<ClientSideDetectionHost> safebrowsing_detection_host_; 37 scoped_ptr<ClientSideDetectionHost> safebrowsing_detection_host_;
44 38
45 // Our owning WebContents. 39 // Our owning WebContents.
46 content::WebContents* web_contents_; 40 content::WebContents* web_contents_;
47 41
48 PrefChangeRegistrar pref_change_registrar_; 42 PrefChangeRegistrar pref_change_registrar_;
49 43
50 DISALLOW_COPY_AND_ASSIGN(SafeBrowsingTabObserver); 44 DISALLOW_COPY_AND_ASSIGN(SafeBrowsingTabObserver);
51 }; 45 };
52 46
53 } // namespace safe_browsing 47 } // namespace safe_browsing
54 48
55 #endif // CHROME_BROWSER_SAFE_BROWSING_SAFE_BROWSING_TAB_OBSERVER_H_ 49 #endif // CHROME_BROWSER_SAFE_BROWSING_SAFE_BROWSING_TAB_OBSERVER_H_
OLDNEW
« no previous file with comments | « chrome/browser/safe_browsing/safe_browsing_service.cc ('k') | chrome/browser/safe_browsing/safe_browsing_tab_observer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698