Chromium Code Reviews| Index: chrome/browser/media/combined_desktop_media_list.h |
| diff --git a/chrome/browser/media/combined_desktop_media_list.h b/chrome/browser/media/combined_desktop_media_list.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..d1cab7c84340e40079aff25a0fe114e077548e5b |
| --- /dev/null |
| +++ b/chrome/browser/media/combined_desktop_media_list.h |
| @@ -0,0 +1,47 @@ |
| +// Copyright 2016 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#ifndef CHROME_BROWSER_MEDIA_COMBINED_DESKTOP_MEDIA_LIST_H_ |
| +#define CHROME_BROWSER_MEDIA_COMBINED_DESKTOP_MEDIA_LIST_H_ |
| + |
| +#include <vector> |
| + |
| +#include "base/memory/scoped_ptr.h" |
| +#include "chrome/browser/media/desktop_media_list.h" |
| +#include "chrome/browser/media/desktop_media_list_observer.h" |
| + |
| +// 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.
|
| +class CombinedDesktopMediaList : public DesktopMediaList, |
| + public DesktopMediaListObserver { |
| + public: |
| + explicit CombinedDesktopMediaList( |
| + std::vector<scoped_ptr<DesktopMediaList>>& media_lists); |
| + ~CombinedDesktopMediaList() override; |
| + |
| + // DesktopMediaList interface. |
| + void SetUpdatePeriod(base::TimeDelta period) override; |
| + void SetThumbnailSize(const gfx::Size& thumbnail_size) override; |
| + void SetViewDialogWindowId(content::DesktopMediaID dialog_id) override; |
| + void StartUpdating(DesktopMediaListObserver* observer) override; |
| + int GetSourceCount() const override; |
| + const Source& GetSource(int index) const override; |
| + |
| + private: |
| + // DesktopMediaListObserver interface. |
| + void OnSourceAdded(DesktopMediaList* list, int index) override; |
| + void OnSourceRemoved(DesktopMediaList* list, int index) override; |
| + void OnSourceMoved(DesktopMediaList* list, |
| + int old_index, |
| + int new_index) override; |
| + void OnSourceNameChanged(DesktopMediaList* list, int index) override; |
| + void OnSourceThumbnailChanged(DesktopMediaList* list, int index) override; |
| + |
| + std::vector<scoped_ptr<DesktopMediaList>> media_lists_; |
| + |
| + DesktopMediaListObserver* observer_ = nullptr; |
| + |
| + DISALLOW_COPY_AND_ASSIGN(CombinedDesktopMediaList); |
| +}; |
| + |
| +#endif // CHROME_BROWSER_MEDIA_COMBINED_DESKTOP_MEDIA_LIST_H_ |