| 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_
|
|
|