 Chromium Code Reviews
 Chromium Code Reviews Issue 2039833004:
  Site Settings Desktop: Implement media picker for camera/mic categories.  (Closed) 
  Base URL: https://chromium.googlesource.com/chromium/src.git@master
    
  
    Issue 2039833004:
  Site Settings Desktop: Implement media picker for camera/mic categories.  (Closed) 
  Base URL: https://chromium.googlesource.com/chromium/src.git@master| 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 56% | 
| 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..46ab0a24967415505f330980d6c831c290cd7574 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,31 @@ | 
| -// Copyright (c) 2012 The Chromium Authors. All rights reserved. | 
| +// Copyright (c) 2016 The Chromium Authors. All rights reserved. | 
| 
michaelpg
2016/06/07 16:03:30
remove (c)
 
Finnur
2016/06/07 16:48:24
Done.
 
michaelpg
2016/06/07 17:00:55
ping
 
Finnur
2016/06/08 12:40:40
I think this is Rietveld being weird. The file on
 | 
| // 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 "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 | 
| 
michaelpg
2016/06/07 16:03:30
since this is in settings/ and isn't called Settin
 
Finnur
2016/06/07 16:48:24
I didn't want a settings_ prefix, per se, but GN b
 
michaelpg
2016/06/07 17:00:55
Ah. You're welcome to do whatever, then. Personall
 
Finnur
2016/06/08 12:40:40
Yeah, I was thinking along the same lines, but wit
 | 
| : public MediaCaptureDevicesDispatcher::Observer, | 
| - public OptionsPageUIHandler { | 
| + public SettingsPageUIHandler { | 
| public: | 
| - MediaDevicesSelectionHandler(); | 
| + explicit MediaDevicesSelectionHandler(content::WebUI* webui); | 
| ~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 +37,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 +50,15 @@ class MediaDevicesSelectionHandler | 
| void UpdateDevicesMenu(DeviceType type, | 
| const content::MediaStreamDevices& devices); | 
| + Profile* profile_; // Weak pointer. | 
| + | 
| + // This class is initialized lazily (on first request). This keeps track of | 
| + // whether that has happened. | 
| + bool initialized_; | 
| + | 
| 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_ |