OLD | NEW |
---|---|
(Empty) | |
1 // Copyright 2016 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_COMBINED_DESKTOP_MEDIA_LIST_H_ | |
6 #define CHROME_BROWSER_MEDIA_COMBINED_DESKTOP_MEDIA_LIST_H_ | |
7 | |
8 #include <vector> | |
9 | |
10 #include "base/memory/scoped_ptr.h" | |
11 #include "chrome/browser/media/desktop_media_list.h" | |
12 #include "chrome/browser/media/desktop_media_list_observer.h" | |
13 | |
14 // Combination of different types of DesktopMediaLists. | |
Sergey Ulanov
2016/01/26 18:06:54
nit: they don't have to be two different types, ju
GeorgeZ
2016/01/27 00:17:38
Done.
| |
15 class CombinedDesktopMediaList : public DesktopMediaList, | |
16 public DesktopMediaListObserver { | |
17 public: | |
18 explicit CombinedDesktopMediaList( | |
19 std::vector<scoped_ptr<DesktopMediaList>>& media_lists); | |
20 ~CombinedDesktopMediaList() override; | |
21 | |
22 // DesktopMediaList interface. | |
23 void SetUpdatePeriod(base::TimeDelta period) override; | |
24 void SetThumbnailSize(const gfx::Size& thumbnail_size) override; | |
25 void SetViewDialogWindowId(content::DesktopMediaID dialog_id) override; | |
26 void StartUpdating(DesktopMediaListObserver* observer) override; | |
27 int GetSourceCount() const override; | |
28 const Source& GetSource(int index) const override; | |
29 | |
30 private: | |
31 // DesktopMediaListObserver interface. | |
32 void OnSourceAdded(DesktopMediaList* list, int index) override; | |
33 void OnSourceRemoved(DesktopMediaList* list, int index) override; | |
34 void OnSourceMoved(DesktopMediaList* list, | |
35 int old_index, | |
36 int new_index) override; | |
37 void OnSourceNameChanged(DesktopMediaList* list, int index) override; | |
38 void OnSourceThumbnailChanged(DesktopMediaList* list, int index) override; | |
39 | |
40 std::vector<scoped_ptr<DesktopMediaList>> media_lists_; | |
41 | |
42 DesktopMediaListObserver* observer_ = nullptr; | |
43 | |
44 DISALLOW_COPY_AND_ASSIGN(CombinedDesktopMediaList); | |
45 }; | |
46 | |
47 #endif // CHROME_BROWSER_MEDIA_COMBINED_DESKTOP_MEDIA_LIST_H_ | |
OLD | NEW |