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