OLD | NEW |
| (Empty) |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | |
2 // Use of this source code is governed by a BSD-style license that can be | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef CHROME_BROWSER_REMOTING_FIREWALL_TRAVERSAL_OBSERVER_H_ | |
6 #define CHROME_BROWSER_REMOTING_FIREWALL_TRAVERSAL_OBSERVER_H_ | |
7 #pragma once | |
8 | |
9 #include "chrome/browser/prefs/pref_change_registrar.h" | |
10 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" | |
11 #include "content/public/browser/notification_observer.h" | |
12 #include "ipc/ipc_channel.h" | |
13 | |
14 // Per-tab class to manage the firewall traversal policies for | |
15 // the remoting plugin. | |
16 // TODO(dmaclach): Replace this with a more generic mechanism for | |
17 // plugins to access preferences. http://crbug.com/90543 | |
18 class FirewallTraversalObserver : public content::NotificationObserver, | |
19 public TabContentsObserver { | |
20 public: | |
21 explicit FirewallTraversalObserver(TabContents* tab_contents); | |
22 virtual ~FirewallTraversalObserver(); | |
23 | |
24 static void RegisterUserPrefs(PrefService* prefs); | |
25 | |
26 // content::NotificationObserver overrides: | |
27 virtual void Observe(int type, | |
28 const content::NotificationSource& source, | |
29 const content::NotificationDetails& details) OVERRIDE; | |
30 | |
31 // IPC::Channel::Listener overrides: | |
32 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; | |
33 | |
34 private: | |
35 void UpdateFirewallTraversalState(); | |
36 | |
37 // Registers and unregisters us for notifications. | |
38 PrefChangeRegistrar pref_change_registrar_; | |
39 | |
40 DISALLOW_COPY_AND_ASSIGN(FirewallTraversalObserver); | |
41 }; | |
42 | |
43 #endif // CHROME_BROWSER_REMOTING_FIREWALL_TRAVERSAL_OBSERVER_H_ | |
OLD | NEW |