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

Side by Side Diff: chrome/browser/intents/device_attached_intent_source.h

Issue 10873072: Rename SystemMonitor's MediaDevice calls to RemovableStorage. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 8 years, 4 months 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_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 <map>
9 #include <string>
10
8 #include "base/memory/weak_ptr.h" 11 #include "base/memory/weak_ptr.h"
9 #include "base/system_monitor/system_monitor.h" 12 #include "base/system_monitor/system_monitor.h"
10 13
11 class Browser; 14 class Browser;
12 15
13 namespace content { 16 namespace content {
14 class WebContentsDelegate; 17 class WebContentsDelegate;
15 } 18 }
16 19
17 // Listens for media devices attached to the system. When such are detected, 20 // Listens for media devices attached to the system. When such are detected,
18 // translates the notification into a Web Intents dispatch. 21 // translates the notification into a Web Intents dispatch.
19 // The intent payload is: 22 // The intent payload is:
20 // action = "chrome-extension://attach" 23 // action = "chrome-extension://attach"
21 // type = "chrome-extension://filesystem" 24 // type = "chrome-extension://filesystem"
22 // root_path = the File Path at which the device is accessible 25 // root_path = the File Path at which the device is accessible
23 // filesystem_id = registered isolated file system identifier 26 // filesystem_id = registered isolated file system identifier
24 class DeviceAttachedIntentSource 27 class DeviceAttachedIntentSource
25 : public base::SystemMonitor::DevicesChangedObserver, 28 : public base::SystemMonitor::DevicesChangedObserver,
26 public base::SupportsWeakPtr<DeviceAttachedIntentSource> { 29 public base::SupportsWeakPtr<DeviceAttachedIntentSource> {
27 public: 30 public:
28 DeviceAttachedIntentSource(Browser* browser, 31 DeviceAttachedIntentSource(Browser* browser,
29 content::WebContentsDelegate* delegate); 32 content::WebContentsDelegate* delegate);
30 virtual ~DeviceAttachedIntentSource(); 33 virtual ~DeviceAttachedIntentSource();
31 34
32 // base::SystemMonitor::DevicesChangedObserver implementation. 35 // base::SystemMonitor::DevicesChangedObserver implementation.
33 virtual void OnMediaDeviceAttached( 36 virtual void OnRemovableStorageAttached(
34 const std::string& id, 37 const std::string& id,
35 const string16& name, 38 const string16& name,
36 const FilePath::StringType& location) OVERRIDE; 39 const FilePath::StringType& location) OVERRIDE;
37 virtual void OnMediaDeviceDetached(const std::string& id) OVERRIDE; 40 virtual void OnRemovableStorageDetached(const std::string& id) OVERRIDE;
38 41
39 // Dispatches web intents for the attached media device specified by 42 // Dispatches web intents for the attached media device specified by
40 // |device_info|. 43 // |device_info|.
41 void DispatchIntentsForService( 44 void DispatchIntentsForService(
42 const base::SystemMonitor::MediaDeviceInfo& device_info); 45 const base::SystemMonitor::RemovableStorageInfo& device_info);
43 46
44 private: 47 private:
45 typedef std::map<std::string, base::SystemMonitor::MediaDeviceInfo> 48 typedef std::map<std::string, base::SystemMonitor::RemovableStorageInfo>
46 DeviceIdToInfoMap; 49 DeviceIdToInfoMap;
47 50
48 // Weak pointer to browser to which intents will be dispatched. 51 // Weak pointer to browser to which intents will be dispatched.
49 Browser* browser_; 52 Browser* browser_;
50 content::WebContentsDelegate* delegate_; 53 content::WebContentsDelegate* delegate_;
51 DeviceIdToInfoMap device_id_map_; 54 DeviceIdToInfoMap device_id_map_;
52 55
53 DISALLOW_COPY_AND_ASSIGN(DeviceAttachedIntentSource); 56 DISALLOW_COPY_AND_ASSIGN(DeviceAttachedIntentSource);
54 }; 57 };
55 58
56 #endif // CHROME_BROWSER_INTENTS_DEVICE_ATTACHED_INTENT_SOURCE_H_ 59 #endif // CHROME_BROWSER_INTENTS_DEVICE_ATTACHED_INTENT_SOURCE_H_
OLDNEW
« no previous file with comments | « base/test/mock_devices_changed_observer.h ('k') | chrome/browser/intents/device_attached_intent_source.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698