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

Unified Diff: chrome/browser/extensions/api/tab_capture/tab_capture_registry.h

Issue 12153002: Move chrome://media-internals to content. This allows us to hide implementation details from the pu… (Closed) Base URL: svn://chrome-svn/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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/extensions/api/tab_capture/tab_capture_registry.h
===================================================================
--- chrome/browser/extensions/api/tab_capture/tab_capture_registry.h (revision 179909)
+++ chrome/browser/extensions/api/tab_capture/tab_capture_registry.h (working copy)
@@ -10,8 +10,7 @@
#include <utility>
#include <vector>
-#include "chrome/browser/media/media_internals.h"
-#include "chrome/browser/media/media_internals_observer.h"
+#include "chrome/browser/media/media_capture_devices_dispatcher.h"
#include "chrome/browser/profiles/profile_keyed_service.h"
#include "chrome/common/extensions/api/tab_capture.h"
#include "content/public/browser/media_request_state.h"
@@ -26,7 +25,8 @@
namespace tab_capture = extensions::api::tab_capture;
class TabCaptureRegistry : public ProfileKeyedService,
- public content::NotificationObserver {
+ public content::NotificationObserver,
+ public MediaCaptureDevicesDispatcher::Observer {
public:
struct TabCaptureRequest {
TabCaptureRequest(std::string extension_id,
@@ -52,49 +52,20 @@
typedef std::map<const std::pair<int, int>, TabCaptureRequest>
DeviceCaptureRequestMap;
- class MediaObserverProxy : public MediaInternalsObserver,
- public base::RefCountedThreadSafe<
- MediaObserverProxy> {
- public:
- MediaObserverProxy() : handler_(NULL) {}
- void Attach(TabCaptureRegistry* handler);
- void Detach();
-
- private:
- friend class base::RefCountedThreadSafe<MediaObserverProxy>;
- virtual ~MediaObserverProxy() {}
-
- // MediaInternalsObserver.
- virtual void OnRequestUpdate(
- int render_process_id,
- int render_view_id,
- const content::MediaStreamDevice& device,
- const content::MediaRequestState state) OVERRIDE;
-
- void RegisterAsMediaObserverOnIOThread(bool unregister);
- void UpdateOnUIThread(
- int render_process_id,
- int render_view_id,
- const content::MediaStreamDevice& device,
- const content::MediaRequestState new_state);
-
- TabCaptureRegistry* handler_;
- };
-
virtual ~TabCaptureRegistry();
- void HandleRequestUpdateOnUIThread(
- int render_process_id,
- int render_view_id,
- const content::MediaStreamDevice& device,
- const content::MediaRequestState state);
-
// content::NotificationObserver implementation.
virtual void Observe(int type,
const content::NotificationSource& source,
const content::NotificationDetails& details) OVERRIDE;
- scoped_refptr<MediaObserverProxy> proxy_;
+ // MediaCaptureDevicesDispatcher::Observer implementation:
scherkus (not reviewing) 2013/02/01 02:05:17 consistency nit: line 57 uses ".", this line uses
jam 2013/02/01 02:18:22 Done.
+ virtual void OnRequestUpdate(
+ int render_process_id,
+ int render_view_id,
+ const content::MediaStreamDevice& device,
+ const content::MediaRequestState state) OVERRIDE;
+
content::NotificationRegistrar registrar_;
Profile* const profile_;
DeviceCaptureRequestMap requests_;

Powered by Google App Engine
This is Rietveld 408576698