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

Unified Diff: chrome/browser/ui/webui/settings/settings_media_devices_selection_handler.h

Issue 2039833004: Site Settings Desktop: Implement media picker for camera/mic categories. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address feedback Created 4 years, 6 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/ui/webui/settings/settings_media_devices_selection_handler.h
diff --git a/chrome/browser/ui/webui/options/media_devices_selection_handler.h b/chrome/browser/ui/webui/settings/settings_media_devices_selection_handler.h
similarity index 55%
copy from chrome/browser/ui/webui/options/media_devices_selection_handler.h
copy to chrome/browser/ui/webui/settings/settings_media_devices_selection_handler.h
index d9478367cc2083b4ee123b2cff3298e5e8b3751e..7489dfe62104b7af90c1586c2a0ea8b577b47055 100644
--- a/chrome/browser/ui/webui/options/media_devices_selection_handler.h
+++ b/chrome/browser/ui/webui/settings/settings_media_devices_selection_handler.h
@@ -1,31 +1,32 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Copyright (c) 2016 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.
-#ifndef CHROME_BROWSER_UI_WEBUI_OPTIONS_MEDIA_DEVICES_SELECTION_HANDLER_H_
-#define CHROME_BROWSER_UI_WEBUI_OPTIONS_MEDIA_DEVICES_SELECTION_HANDLER_H_
+#ifndef CHROME_BROWSER_UI_WEBUI_SETTINGS_SETTINGS_MEDIA_DEVICES_SELECTION_HANDLER_H_
+#define CHROME_BROWSER_UI_WEBUI_SETTINGS_SETTINGS_MEDIA_DEVICES_SELECTION_HANDLER_H_
#include "base/macros.h"
+#include "base/scoped_observer.h"
#include "chrome/browser/media/media_capture_devices_dispatcher.h"
-#include "chrome/browser/ui/webui/options/options_ui.h"
+#include "chrome/browser/ui/webui/settings/settings_page_ui_handler.h"
#include "content/public/browser/web_contents.h"
-namespace options {
+namespace settings {
// Handler for media devices selection in content settings.
class MediaDevicesSelectionHandler
: public MediaCaptureDevicesDispatcher::Observer,
- public OptionsPageUIHandler {
+ public SettingsPageUIHandler {
public:
- MediaDevicesSelectionHandler();
+ explicit MediaDevicesSelectionHandler(Profile* profile);
~MediaDevicesSelectionHandler() override;
- // OptionsPageUIHandler implementation.
- void GetLocalizedValues(base::DictionaryValue* values) override;
- void InitializePage() override;
+ // SettingsPageUIHandler:
+ void OnJavascriptAllowed() override;
+ void OnJavascriptDisallowed() override;
void RegisterMessages() override;
- // MediaCaptureDevicesDispatcher::Observer implementation.
+ // MediaCaptureDevicesDispatcher::Observer:
void OnUpdateAudioDevices(
const content::MediaStreamDevices& devices) override;
void OnUpdateVideoDevices(
@@ -37,6 +38,9 @@ class MediaDevicesSelectionHandler
VIDEO,
};
+ // Fetches the list of default capture devices.
+ void GetDefaultCaptureDevices(const base::ListValue* args);
+
// Sets the default audio/video capture device for media. |args| includes the
// media type (kAuudio/kVideo) and the unique id of the new default device
// that the user has chosen.
@@ -47,9 +51,14 @@ class MediaDevicesSelectionHandler
void UpdateDevicesMenu(DeviceType type,
const content::MediaStreamDevices& devices);
+ Profile* profile_; // Weak pointer.
+
+ ScopedObserver<MediaCaptureDevicesDispatcher,
+ MediaCaptureDevicesDispatcher::Observer> observer_;
+
DISALLOW_COPY_AND_ASSIGN(MediaDevicesSelectionHandler);
};
-} // namespace options
+} // namespace settings
-#endif // CHROME_BROWSER_UI_WEBUI_OPTIONS_MEDIA_DEVICES_SELECTION_HANDLER_H_
+#endif // CHROME_BROWSER_UI_WEBUI_SETTINGS_SETTINGS_MEDIA_DEVICES_SELECTION_HANDLER_H_

Powered by Google App Engine
This is Rietveld 408576698