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_INTENTS_DEVICE_ATTACHED_INTENT_SOURCE_H_ | 5 #ifndef CHROME_BROWSER_INTENTS_DEVICE_ATTACHED_INTENT_SOURCE_H_ |
6 #define CHROME_BROWSER_INTENTS_DEVICE_ATTACHED_INTENT_SOURCE_H_ | 6 #define CHROME_BROWSER_INTENTS_DEVICE_ATTACHED_INTENT_SOURCE_H_ |
7 | 7 |
8 #include "base/memory/weak_ptr.h" | 8 #include "base/memory/weak_ptr.h" |
9 #include "base/system_monitor/system_monitor.h" | 9 #include "base/system_monitor/system_monitor.h" |
10 | 10 |
(...skipping 15 matching lines...) Expand all Loading... |
26 public base::SupportsWeakPtr<DeviceAttachedIntentSource> { | 26 public base::SupportsWeakPtr<DeviceAttachedIntentSource> { |
27 public: | 27 public: |
28 DeviceAttachedIntentSource(Browser* browser, | 28 DeviceAttachedIntentSource(Browser* browser, |
29 content::WebContentsDelegate* delegate); | 29 content::WebContentsDelegate* delegate); |
30 virtual ~DeviceAttachedIntentSource(); | 30 virtual ~DeviceAttachedIntentSource(); |
31 | 31 |
32 // base::SystemMonitor::DevicesChangedObserver implementation. | 32 // base::SystemMonitor::DevicesChangedObserver implementation. |
33 virtual void OnMediaDeviceAttached( | 33 virtual void OnMediaDeviceAttached( |
34 const std::string& id, | 34 const std::string& id, |
35 const string16& name, | 35 const string16& name, |
36 base::SystemMonitor::MediaDeviceType type, | |
37 const FilePath::StringType& location) OVERRIDE; | 36 const FilePath::StringType& location) OVERRIDE; |
38 virtual void OnMediaDeviceDetached(const std::string& id) OVERRIDE; | 37 virtual void OnMediaDeviceDetached(const std::string& id) OVERRIDE; |
39 | 38 |
40 // Dispatches web intents for the attached media device specified by | 39 // Dispatches web intents for the attached media device specified by |
41 // |device_info|. | 40 // |device_info|. |
42 void DispatchIntentsForService( | 41 void DispatchIntentsForService( |
43 const base::SystemMonitor::MediaDeviceInfo& device_info); | 42 const base::SystemMonitor::MediaDeviceInfo& device_info); |
44 | 43 |
45 private: | 44 private: |
46 typedef std::map<std::string, base::SystemMonitor::MediaDeviceInfo> | 45 typedef std::map<std::string, base::SystemMonitor::MediaDeviceInfo> |
47 DeviceIdToInfoMap; | 46 DeviceIdToInfoMap; |
48 | 47 |
49 // Weak pointer to browser to which intents will be dispatched. | 48 // Weak pointer to browser to which intents will be dispatched. |
50 Browser* browser_; | 49 Browser* browser_; |
51 content::WebContentsDelegate* delegate_; | 50 content::WebContentsDelegate* delegate_; |
52 DeviceIdToInfoMap device_id_map_; | 51 DeviceIdToInfoMap device_id_map_; |
53 | 52 |
54 DISALLOW_COPY_AND_ASSIGN(DeviceAttachedIntentSource); | 53 DISALLOW_COPY_AND_ASSIGN(DeviceAttachedIntentSource); |
55 }; | 54 }; |
56 | 55 |
57 #endif // CHROME_BROWSER_INTENTS_DEVICE_ATTACHED_INTENT_SOURCE_H_ | 56 #endif // CHROME_BROWSER_INTENTS_DEVICE_ATTACHED_INTENT_SOURCE_H_ |
OLD | NEW |