1 // Copyright 2018 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_WEBRTC_DESKTOP_MEDIA_PICKER_FACTORY_IMPL_H_
6 #define CHROME_BROWSER_MEDIA_WEBRTC_DESKTOP_MEDIA_PICKER_FACTORY_IMPL_H_
7 
8 #include <memory>
9 #include <vector>
10 
11 #include "chrome/browser/media/webrtc/desktop_media_list.h"
12 #include "chrome/browser/media/webrtc/desktop_media_picker.h"
13 #include "chrome/browser/media/webrtc/desktop_media_picker_factory.h"
14 #include "content/public/browser/desktop_media_id.h"
15 
16 // Factory creating DesktopMediaList and DesktopMediaPicker instances.
17 class DesktopMediaPickerFactoryImpl : public DesktopMediaPickerFactory {
18  public:
19   DesktopMediaPickerFactoryImpl();
20   ~DesktopMediaPickerFactoryImpl() override;
21 
22   // Get the lazy initialized instance of the factory.
23   static DesktopMediaPickerFactoryImpl* GetInstance();
24 
25   // DesktopMediaPickerFactory implementation
26   // Can return |nullptr| if platform doesn't support DesktopMediaPicker.
27   std::unique_ptr<DesktopMediaPicker> CreatePicker() override;
28   std::vector<std::unique_ptr<DesktopMediaList>> CreateMediaList(
29       const std::vector<content::DesktopMediaID::Type>& types) override;
30 
31  private:
32   DISALLOW_COPY_AND_ASSIGN(DesktopMediaPickerFactoryImpl);
33 };
34 
35 #endif  // CHROME_BROWSER_MEDIA_WEBRTC_DESKTOP_MEDIA_PICKER_FACTORY_IMPL_H_
36