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_WEBRTC_FAKE_DESKTOP_MEDIA_LIST_H_
6 #define CHROME_BROWSER_MEDIA_WEBRTC_FAKE_DESKTOP_MEDIA_LIST_H_
7 
8 #include <vector>
9 
10 #include "chrome/browser/media/webrtc/desktop_media_list.h"
11 
12 class FakeDesktopMediaList : public DesktopMediaList {
13  public:
14   explicit FakeDesktopMediaList(content::DesktopMediaID::Type type);
15   ~FakeDesktopMediaList() override;
16 
17   void AddSource(int id);
18   void AddSourceByFullMediaID(content::DesktopMediaID media_id);
19   void RemoveSource(int index);
20   void MoveSource(int old_index, int new_index);
21   void SetSourceThumbnail(int index);
22   void SetSourceName(int index, base::string16 name);
23 
24   // DesktopMediaList implementation:
25   void SetUpdatePeriod(base::TimeDelta period) override;
26   void SetThumbnailSize(const gfx::Size& thumbnail_size) override;
27   void SetViewDialogWindowId(content::DesktopMediaID dialog_id) override;
28   void StartUpdating(DesktopMediaListObserver* observer) override;
29   void Update(UpdateCallback callback) override;
30   int GetSourceCount() const override;
31   const Source& GetSource(int index) const override;
32   content::DesktopMediaID::Type GetMediaListType() const override;
33 
34  private:
35   std::vector<Source> sources_;
36   DesktopMediaListObserver* observer_;
37   gfx::ImageSkia thumbnail_;
38   const content::DesktopMediaID::Type type_;
39 
40   DISALLOW_COPY_AND_ASSIGN(FakeDesktopMediaList);
41 };
42 
43 #endif  // CHROME_BROWSER_MEDIA_WEBRTC_FAKE_DESKTOP_MEDIA_LIST_H_
44