OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CHROME_BROWSER_MEDIA_DESKTOP_MEDIA_LIST_BASE_H_ | 5 #ifndef CHROME_BROWSER_MEDIA_DESKTOP_MEDIA_LIST_BASE_H_ |
6 #define CHROME_BROWSER_MEDIA_DESKTOP_MEDIA_LIST_BASE_H_ | 6 #define CHROME_BROWSER_MEDIA_DESKTOP_MEDIA_LIST_BASE_H_ |
7 | 7 |
8 #include "chrome/browser/media/desktop_media_list.h" | 8 #include "chrome/browser/media/desktop_media_list.h" |
9 #include "content/public/browser/desktop_media_id.h" | 9 #include "content/public/browser/desktop_media_id.h" |
10 | 10 |
11 // Thumbnail size is 100*100 pixels | 11 // Thumbnail size is 100*100 pixels |
12 static const int kDefaultThumbnailSize = 100; | 12 static const int kDefaultThumbnailSize = 100; |
13 | 13 |
14 // Base class for DesktopMedaiList implementations. Implements logic shared | 14 // Base class for DesktopMediaList implementations. Implements logic shared |
15 // between implementations. Specifically it's responsible for keeping current | 15 // between implementations. Specifically it's responsible for keeping current |
16 // list of sources and calling the observer when the list changes. | 16 // list of sources and calling the observer when the list changes. |
17 class DesktopMediaListBase : public DesktopMediaList { | 17 class DesktopMediaListBase : public DesktopMediaList { |
18 public: | 18 public: |
19 explicit DesktopMediaListBase(base::TimeDelta update_period); | 19 explicit DesktopMediaListBase(base::TimeDelta update_period); |
20 ~DesktopMediaListBase() override; | 20 ~DesktopMediaListBase() override; |
21 | 21 |
22 // DesktopMediaList interface. | 22 // DesktopMediaList interface. |
23 void SetUpdatePeriod(base::TimeDelta period) override; | 23 void SetUpdatePeriod(base::TimeDelta period) override; |
24 void SetThumbnailSize(const gfx::Size& thumbnail_size) override; | 24 void SetThumbnailSize(const gfx::Size& thumbnail_size) override; |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
64 | 64 |
65 // The observer passed to StartUpdating(). | 65 // The observer passed to StartUpdating(). |
66 DesktopMediaListObserver* observer_ = nullptr; | 66 DesktopMediaListObserver* observer_ = nullptr; |
67 | 67 |
68 base::WeakPtrFactory<DesktopMediaListBase> weak_factory_; | 68 base::WeakPtrFactory<DesktopMediaListBase> weak_factory_; |
69 | 69 |
70 DISALLOW_COPY_AND_ASSIGN(DesktopMediaListBase); | 70 DISALLOW_COPY_AND_ASSIGN(DesktopMediaListBase); |
71 }; | 71 }; |
72 | 72 |
73 #endif // CHROME_BROWSER_MEDIA_DESKTOP_MEDIA_LIST_BASE_H_ | 73 #endif // CHROME_BROWSER_MEDIA_DESKTOP_MEDIA_LIST_BASE_H_ |
OLD | NEW |