Rename GetIconID to GetIconId
[chromium-blink-merge.git] / chrome / browser / media / desktop_media_list.h
blob99e2f23e8c5f9b1134bb10e5093e74b4c4067234
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.
5 #ifndef CHROME_BROWSER_MEDIA_DESKTOP_MEDIA_LIST_H_
6 #define CHROME_BROWSER_MEDIA_DESKTOP_MEDIA_LIST_H_
8 #include "base/basictypes.h"
9 #include "base/strings/string16.h"
10 #include "base/time/time.h"
11 #include "content/public/browser/desktop_media_id.h"
12 #include "ui/gfx/image/image_skia.h"
14 class DesktopMediaListObserver;
16 // DesktopMediaList provides the list of desktop media source (screens, windows,
17 // tabs), and their thumbnails, to the desktop media picker dialog. It
18 // transparently updates the list in the background, and notifies the desktop
19 // media picker when something changes.
20 class DesktopMediaList {
21 public:
22 // Struct used to represent each entry in the list.
23 struct Source {
24 // Id of the source.
25 content::DesktopMediaID id;
27 // Name of the source that should be shown to the user.
28 base::string16 name;
30 // The thumbnail for the source.
31 gfx::ImageSkia thumbnail;
34 virtual ~DesktopMediaList() {}
36 // Sets time interval between updates. By default list of sources and their
37 // thumbnail are updated once per second. If called after StartUpdating() then
38 // it will take effect only after the next update.
39 virtual void SetUpdatePeriod(base::TimeDelta period) = 0;
41 // Sets size to which the thumbnails should be scaled. If called after
42 // StartUpdating() then some thumbnails may be still scaled to the old size
43 // until they are updated.
44 virtual void SetThumbnailSize(const gfx::Size& thumbnail_size) = 0;
46 // Sets ID of the hosting desktop picker dialog. The window with this ID will
47 // be filtered out from the list of sources.
49 // TODO(miu): The entire DesktopMediaID, not just the Id field should be
50 // passed here. http://crbug.com/513490
51 virtual void SetViewDialogWindowId(content::DesktopMediaID::Id dialog_id) = 0;
53 // Starts updating the model. The model is initially empty, so OnSourceAdded()
54 // notifications will be generated for each existing source as it is
55 // enumerated. After the initial enumeration the model will be refreshed based
56 // on the update period, and notifications generated only for changes in the
57 // model.
58 virtual void StartUpdating(DesktopMediaListObserver* observer) = 0;
60 virtual int GetSourceCount() const = 0;
61 virtual const Source& GetSource(int index) const = 0;
64 #endif // CHROME_BROWSER_MEDIA_DESKTOP_MEDIA_LIST_H_