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

Unified Diff: chrome/browser/media/desktop_media_list_base.h

Issue 2307083002: Cleanup: move WebRTC related files from chrome/browser/media to chrome/browser/media/webrtc/ (Closed)
Patch Set: Removed file wrongly resuscitated during rebase Created 4 years, 3 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/media/desktop_media_list_base.h
diff --git a/chrome/browser/media/desktop_media_list_base.h b/chrome/browser/media/desktop_media_list_base.h
deleted file mode 100644
index 1ac07a66e110c08a5bc3597da199a09e97aa9839..0000000000000000000000000000000000000000
--- a/chrome/browser/media/desktop_media_list_base.h
+++ /dev/null
@@ -1,79 +0,0 @@
-// 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_DESKTOP_MEDIA_LIST_BASE_H_
-#define CHROME_BROWSER_MEDIA_DESKTOP_MEDIA_LIST_BASE_H_
-
-#include "chrome/browser/media/desktop_media_list.h"
-#include "content/public/browser/desktop_media_id.h"
-
-namespace gfx {
-class Image;
-}
-
-// Thumbnail size is 100*100 pixels
-static const int kDefaultThumbnailSize = 100;
-
-// Base class for DesktopMediaList implementations. Implements logic shared
-// between implementations. Specifically it's responsible for keeping current
-// list of sources and calling the observer when the list changes.
-class DesktopMediaListBase : public DesktopMediaList {
- public:
- explicit DesktopMediaListBase(base::TimeDelta update_period);
- ~DesktopMediaListBase() 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;
-
- static uint32_t GetImageHash(const gfx::Image& image);
-
- protected:
- struct SourceDescription {
- SourceDescription(content::DesktopMediaID id, const base::string16& name);
-
- content::DesktopMediaID id;
- base::string16 name;
- };
-
- virtual void Refresh() = 0;
-
- // Update source media list to observer.
- void UpdateSourcesList(const std::vector<SourceDescription>& new_sources);
-
- // Update a thumbnail to observer.
- void UpdateSourceThumbnail(content::DesktopMediaID id,
- const gfx::ImageSkia& image);
-
- // Post a task for next list update.
- void ScheduleNextRefresh();
-
- // Size of thumbnails generated by the model.
- gfx::Size thumbnail_size_ =
- gfx::Size(kDefaultThumbnailSize, kDefaultThumbnailSize);
-
- // ID of the hosting dialog.
- content::DesktopMediaID view_dialog_id_ =
- content::DesktopMediaID(content::DesktopMediaID::TYPE_NONE, -1);
-
- private:
- // Time interval between mode updates.
- base::TimeDelta update_period_;
-
- // Current list of sources.
- std::vector<Source> sources_;
-
- // The observer passed to StartUpdating().
- DesktopMediaListObserver* observer_ = nullptr;
-
- base::WeakPtrFactory<DesktopMediaListBase> weak_factory_;
-
- DISALLOW_COPY_AND_ASSIGN(DesktopMediaListBase);
-};
-
-#endif // CHROME_BROWSER_MEDIA_DESKTOP_MEDIA_LIST_BASE_H_
« no previous file with comments | « chrome/browser/media/desktop_media_list_ash_unittest.cc ('k') | chrome/browser/media/desktop_media_list_base.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698