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

Side by Side Diff: chrome/browser/media/media_capture_devices_dispatcher.h

Issue 12079097: Introduce PrefRegistrySyncable, simplifying PrefServiceSyncable. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Merge to head again; base::File changes conflicted. Created 7 years, 10 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_MEDIA_MEDIA_CAPTURE_DEVICES_DISPATCHER_H_ 5 #ifndef CHROME_BROWSER_MEDIA_MEDIA_CAPTURE_DEVICES_DISPATCHER_H_
6 #define CHROME_BROWSER_MEDIA_MEDIA_CAPTURE_DEVICES_DISPATCHER_H_ 6 #define CHROME_BROWSER_MEDIA_MEDIA_CAPTURE_DEVICES_DISPATCHER_H_
7 7
8 #include "base/callback.h" 8 #include "base/callback.h"
9 #include "base/memory/scoped_ptr.h" 9 #include "base/memory/scoped_ptr.h"
10 #include "base/memory/singleton.h" 10 #include "base/memory/singleton.h"
11 #include "base/observer_list.h" 11 #include "base/observer_list.h"
12 #include "content/public/browser/media_observer.h" 12 #include "content/public/browser/media_observer.h"
13 #include "content/public/common/media_stream_request.h" 13 #include "content/public/common/media_stream_request.h"
14 14
15 class MediaStreamCaptureIndicator; 15 class MediaStreamCaptureIndicator;
16 class PrefServiceSyncable; 16 class PrefRegistrySyncable;
17 class PrefService;
17 class Profile; 18 class Profile;
18 19
19 // This singleton is used to receive updates about media events from the content 20 // This singleton is used to receive updates about media events from the content
20 // layer. 21 // layer.
21 class MediaCaptureDevicesDispatcher : public content::MediaObserver { 22 class MediaCaptureDevicesDispatcher : public content::MediaObserver {
22 public: 23 public:
23 class Observer { 24 class Observer {
24 public: 25 public:
25 // Handle an information update consisting of a up-to-date audio capture 26 // Handle an information update consisting of a up-to-date audio capture
26 // device lists. This happens when a microphone is plugged in or unplugged. 27 // device lists. This happens when a microphone is plugged in or unplugged.
(...skipping 11 matching lines...) Expand all
38 int render_view_id, 39 int render_view_id,
39 const content::MediaStreamDevice& device, 40 const content::MediaStreamDevice& device,
40 const content::MediaRequestState state) {} 41 const content::MediaRequestState state) {}
41 42
42 virtual ~Observer() {} 43 virtual ~Observer() {}
43 }; 44 };
44 45
45 static MediaCaptureDevicesDispatcher* GetInstance(); 46 static MediaCaptureDevicesDispatcher* GetInstance();
46 47
47 // Registers the preferences related to Media Stream default devices. 48 // Registers the preferences related to Media Stream default devices.
48 static void RegisterUserPrefs(PrefServiceSyncable* user_prefs); 49 static void RegisterUserPrefs(PrefService* user_prefs,
50 PrefRegistrySyncable* registry);
49 51
50 // Methods for observers. Called on UI thread. 52 // Methods for observers. Called on UI thread.
51 // Observers should add themselves on construction and remove themselves 53 // Observers should add themselves on construction and remove themselves
52 // on destruction. 54 // on destruction.
53 void AddObserver(Observer* observer); 55 void AddObserver(Observer* observer);
54 void RemoveObserver(Observer* observer); 56 void RemoveObserver(Observer* observer);
55 const content::MediaStreamDevices& GetAudioCaptureDevices(); 57 const content::MediaStreamDevices& GetAudioCaptureDevices();
56 const content::MediaStreamDevices& GetVideoCaptureDevices(); 58 const content::MediaStreamDevices& GetVideoCaptureDevices();
57 59
58 // Helper to get the default devices which can be used by the media request, 60 // Helper to get the default devices which can be used by the media request,
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
119 ObserverList<Observer> observers_; 121 ObserverList<Observer> observers_;
120 122
121 // Flag to indicate if device enumeration has been done/doing. 123 // Flag to indicate if device enumeration has been done/doing.
122 // Only accessed on UI thread. 124 // Only accessed on UI thread.
123 bool devices_enumerated_; 125 bool devices_enumerated_;
124 126
125 scoped_refptr<MediaStreamCaptureIndicator> media_stream_capture_indicator_; 127 scoped_refptr<MediaStreamCaptureIndicator> media_stream_capture_indicator_;
126 }; 128 };
127 129
128 #endif // CHROME_BROWSER_MEDIA_MEDIA_CAPTURE_DEVICES_DISPATCHER_H_ 130 #endif // CHROME_BROWSER_MEDIA_MEDIA_CAPTURE_DEVICES_DISPATCHER_H_
OLDNEW
« no previous file with comments | « chrome/browser/managed_mode/managed_user_service.cc ('k') | chrome/browser/media/media_capture_devices_dispatcher.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698