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 #include "chrome/browser/media/desktop_media_list_base.h" | 5 #include "chrome/browser/media/webrtc/desktop_media_list_base.h" |
6 | 6 |
7 #include <set> | 7 #include <set> |
8 | 8 |
9 #include "chrome/browser/media/desktop_media_list_observer.h" | 9 #include "chrome/browser/media/webrtc/desktop_media_list_observer.h" |
10 #include "content/public/browser/browser_thread.h" | 10 #include "content/public/browser/browser_thread.h" |
11 #include "ui/gfx/image/image.h" | 11 #include "ui/gfx/image/image.h" |
12 | 12 |
13 using content::BrowserThread; | 13 using content::BrowserThread; |
14 using content::DesktopMediaID; | 14 using content::DesktopMediaID; |
15 | 15 |
16 DesktopMediaListBase::DesktopMediaListBase(base::TimeDelta update_period) | 16 DesktopMediaListBase::DesktopMediaListBase(base::TimeDelta update_period) |
17 : update_period_(update_period), weak_factory_(this) {} | 17 : update_period_(update_period), weak_factory_(this) {} |
18 | 18 |
19 DesktopMediaListBase::~DesktopMediaListBase() {} | 19 DesktopMediaListBase::~DesktopMediaListBase() {} |
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
137 // static | 137 // static |
138 uint32_t DesktopMediaListBase::GetImageHash(const gfx::Image& image) { | 138 uint32_t DesktopMediaListBase::GetImageHash(const gfx::Image& image) { |
139 SkBitmap bitmap = image.AsBitmap(); | 139 SkBitmap bitmap = image.AsBitmap(); |
140 bitmap.lockPixels(); | 140 bitmap.lockPixels(); |
141 uint32_t value = | 141 uint32_t value = |
142 base::Hash(reinterpret_cast<char*>(bitmap.getPixels()), bitmap.getSize()); | 142 base::Hash(reinterpret_cast<char*>(bitmap.getPixels()), bitmap.getSize()); |
143 bitmap.unlockPixels(); | 143 bitmap.unlockPixels(); |
144 | 144 |
145 return value; | 145 return value; |
146 } | 146 } |
OLD | NEW |