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

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

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

Powered by Google App Engine
This is Rietveld 408576698