Index: content/browser/renderer_host/media/media_stream_ui_controller.h |
diff --git a/content/browser/renderer_host/media/media_stream_ui_controller.h b/content/browser/renderer_host/media/media_stream_ui_controller.h |
deleted file mode 100644 |
index 6d14e830d8186809e962c2ad59c2c4181d50d662..0000000000000000000000000000000000000000 |
--- a/content/browser/renderer_host/media/media_stream_ui_controller.h |
+++ /dev/null |
@@ -1,106 +0,0 @@ |
-// Copyright (c) 2012 The Chromium Authors. All rights reserved. |
-// Use of this source code is governed by a BSD-style license that can be |
-// found in the LICENSE file. |
- |
-// MediaStreamUIController is used to decide which of the available capture |
-// device to use as well as getting user permission to use the capture device. |
-// There will be one instance of MediaStreamDeviceSettings handling all |
-// requests. |
- |
-// Expected call flow: |
-// 1. MakeUIRequest() is called to create a new request to the UI for capture |
-// device access. |
-// 2. Pick device and get user confirmation. |
-// 3. Confirm by calling SettingsRequester::DevicesAccepted(). |
-// Repeat step 1 - 3 for new device requests. |
- |
-#ifndef CONTENT_BROWSER_RENDERER_HOST_MEDIA_MEDIA_STREAM_UI_CONTROLLER_H_ |
-#define CONTENT_BROWSER_RENDERER_HOST_MEDIA_MEDIA_STREAM_UI_CONTROLLER_H_ |
- |
-#include <map> |
-#include <string> |
- |
-#include "base/basictypes.h" |
-#include "content/browser/renderer_host/media/media_stream_provider.h" |
-#include "content/public/browser/web_contents_delegate.h" |
- |
-namespace content { |
- |
-class MediaStreamRequestForUI; |
-class SettingsRequester; |
- |
-// MediaStreamUIController is responsible for getting user permission to use |
-// a media capture device as well as selecting what device to use. |
-class CONTENT_EXPORT MediaStreamUIController { |
- public: |
- explicit MediaStreamUIController(SettingsRequester* requester); |
- virtual ~MediaStreamUIController(); |
- |
- // Called when a new request for the capture device access is made. |
- // Users are responsible for canceling the pending request if they don't wait |
- // for the result from the UI. |
- void MakeUIRequest(const std::string& label, |
- int render_process_id, |
- int render_view_id, |
- const StreamOptions& stream_components, |
- const GURL& security_origin, |
- MediaStreamRequestType request_type, |
- const std::string& requested_device_id); |
- |
- // Called to cancel a pending UI request of capture device access when the |
- // user has no action for the media stream InfoBar. |
- void CancelUIRequest(const std::string& label); |
- |
- // Called to signal the UI indicator that the devices are opened. |
- void NotifyUIIndicatorDevicesOpened(const std::string& label); |
- |
- // Called to signal the UI indicator that the devices are closed. |
- void NotifyUIIndicatorDevicesClosed(const std::string& label); |
- |
- // Used for testing only. This function is called to use faked UI, which is |
- // needed for server based tests. The first non-opened device(s) will be |
- // picked. |
- void UseFakeUI(scoped_ptr<MediaStreamUI> fake_ui); |
- |
- private: |
- typedef std::map<std::string, MediaStreamRequestForUI*> UIRequests; |
- typedef std::map<std::string, MediaStreamUI*> IndicatorsMap; |
- |
- // Returns true if the UI is already processing a request for this render |
- // view. |
- bool IsUIBusy(int render_process_id, int render_view_id); |
- |
- // Process the next pending request and bring it up to the UI on the given |
- // page for user approval. |
- void ProcessNextRequestForView(int render_process_id, int render_view_id); |
- |
- // Posts a request to be approved/denied by UI. |
- void PostRequestToUI(const std::string& label); |
- |
- // Posts a request to fake UI which is used for testing purpose. |
- void PostRequestToFakeUI(const std::string& label); |
- |
- // Callback handler for WebContents::RequestMediaAccessPermission(). |
- void ProcessAccessRequestResponse(const std::string& label, |
- const MediaStreamDevices& devices, |
- scoped_ptr<MediaStreamUI> stream_ui); |
- |
- // Callback for UI called when user requests a stream to be stopped. |
- void OnStopStreamFromUI(const std::string& label); |
- |
- SettingsRequester* requester_; |
- UIRequests requests_; |
- |
- // See comment above for method UseFakeUI. Used for automated testing. |
- bool use_fake_ui_; |
- scoped_ptr<MediaStreamUI> fake_ui_; |
- |
- // Container MediaStreamUI objects for currently active streams. |
- IndicatorsMap stream_indicators_; |
- |
- DISALLOW_COPY_AND_ASSIGN(MediaStreamUIController); |
-}; |
- |
-} // namespace content |
- |
-#endif // CONTENT_BROWSER_RENDERER_HOST_MEDIA_MEDIA_STREAM_UI_CONTROLLER_H_ |