| OLD | NEW |
| (Empty) |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef CHROME_BROWSER_MEDIA_DESKTOP_MEDIA_PICKER_H_ | |
| 6 #define CHROME_BROWSER_MEDIA_DESKTOP_MEDIA_PICKER_H_ | |
| 7 | |
| 8 #include <memory> | |
| 9 | |
| 10 #include "base/callback_forward.h" | |
| 11 #include "base/macros.h" | |
| 12 #include "base/strings/string16.h" | |
| 13 #include "content/public/browser/desktop_media_id.h" | |
| 14 #include "ui/gfx/native_widget_types.h" | |
| 15 | |
| 16 class DesktopMediaList; | |
| 17 | |
| 18 namespace content { | |
| 19 class WebContents; | |
| 20 } | |
| 21 | |
| 22 // Abstract interface for desktop media picker UI. It's used by Desktop Media | |
| 23 // API to let user choose a desktop media source. | |
| 24 class DesktopMediaPicker { | |
| 25 public: | |
| 26 typedef base::Callback<void(content::DesktopMediaID)> DoneCallback; | |
| 27 | |
| 28 // Creates default implementation of DesktopMediaPicker for the current | |
| 29 // platform. | |
| 30 static std::unique_ptr<DesktopMediaPicker> Create(); | |
| 31 | |
| 32 DesktopMediaPicker() {} | |
| 33 virtual ~DesktopMediaPicker() {} | |
| 34 | |
| 35 // Shows dialog with list of desktop media sources (screens, windows, tabs) | |
| 36 // provided by |screen_list|, |window_list| and |tab_list|. | |
| 37 // Dialog window will call |done_callback| when user chooses one of the | |
| 38 // sources or closes the dialog. | |
| 39 virtual void Show(content::WebContents* web_contents, | |
| 40 gfx::NativeWindow context, | |
| 41 gfx::NativeWindow parent, | |
| 42 const base::string16& app_name, | |
| 43 const base::string16& target_name, | |
| 44 std::unique_ptr<DesktopMediaList> screen_list, | |
| 45 std::unique_ptr<DesktopMediaList> window_list, | |
| 46 std::unique_ptr<DesktopMediaList> tab_list, | |
| 47 bool request_audio, | |
| 48 const DoneCallback& done_callback) = 0; | |
| 49 | |
| 50 private: | |
| 51 DISALLOW_COPY_AND_ASSIGN(DesktopMediaPicker); | |
| 52 }; | |
| 53 | |
| 54 #endif // CHROME_BROWSER_MEDIA_DESKTOP_MEDIA_PICKER_H_ | |
| OLD | NEW |