Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(28)

Side by Side Diff: chrome/browser/media/combined_desktop_media_list.h

Issue 1622733002: Add CombinedDesktopMediaList class (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | chrome/browser/media/combined_desktop_media_list.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(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 // The combined desktop media list of one or multiple input DesktopMediaLists.
15 // The combined list is the concatenation of the input lists. The front of
16 // combined list will be filled with the first input list, then follows with
17 // the second one and so on.
18 class CombinedDesktopMediaList : public DesktopMediaList,
19 public DesktopMediaListObserver {
20 public:
21 explicit CombinedDesktopMediaList(
22 std::vector<scoped_ptr<DesktopMediaList>>& media_lists);
23 ~CombinedDesktopMediaList() override;
24
25 // DesktopMediaList interface.
26 void SetUpdatePeriod(base::TimeDelta period) override;
27 void SetThumbnailSize(const gfx::Size& thumbnail_size) override;
28 void SetViewDialogWindowId(content::DesktopMediaID dialog_id) override;
29 void StartUpdating(DesktopMediaListObserver* observer) override;
30 int GetSourceCount() const override;
31 const Source& GetSource(int index) const override;
32
33 private:
34 // DesktopMediaListObserver interface.
35 void OnSourceAdded(DesktopMediaList* list, int index) override;
36 void OnSourceRemoved(DesktopMediaList* list, int index) override;
37 void OnSourceMoved(DesktopMediaList* list,
38 int old_index,
39 int new_index) override;
40 void OnSourceNameChanged(DesktopMediaList* list, int index) override;
41 void OnSourceThumbnailChanged(DesktopMediaList* list, int index) override;
42
43 std::vector<scoped_ptr<DesktopMediaList>> media_lists_;
44
45 DesktopMediaListObserver* observer_ = nullptr;
46
47 DISALLOW_COPY_AND_ASSIGN(CombinedDesktopMediaList);
48 };
49
50 #endif // CHROME_BROWSER_MEDIA_COMBINED_DESKTOP_MEDIA_LIST_H_
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/media/combined_desktop_media_list.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698