| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 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 | 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/fake_desktop_media_list.h" | 5 #include "chrome/browser/media/fake_desktop_media_list.h" |
| 6 | 6 |
| 7 #include "chrome/browser/media/desktop_media_list_observer.h" | 7 #include "chrome/browser/media/desktop_media_list_observer.h" |
| 8 #include "ui/gfx/skia_util.h" | 8 #include "ui/gfx/skia_util.h" |
| 9 | 9 |
| 10 FakeDesktopMediaList::FakeDesktopMediaList() : observer_(NULL) {} | 10 FakeDesktopMediaList::FakeDesktopMediaList() : observer_(NULL) {} |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 47 | 47 |
| 48 void FakeDesktopMediaList::SetViewDialogWindowId( | 48 void FakeDesktopMediaList::SetViewDialogWindowId( |
| 49 content::DesktopMediaID::Id dialog_id) {} | 49 content::DesktopMediaID::Id dialog_id) {} |
| 50 | 50 |
| 51 void FakeDesktopMediaList::StartUpdating(DesktopMediaListObserver* observer) { | 51 void FakeDesktopMediaList::StartUpdating(DesktopMediaListObserver* observer) { |
| 52 observer_ = observer; | 52 observer_ = observer; |
| 53 | 53 |
| 54 SkBitmap bitmap; | 54 SkBitmap bitmap; |
| 55 bitmap.setConfig(SkBitmap::kARGB_8888_Config, 150, 150); | 55 bitmap.setConfig(SkBitmap::kARGB_8888_Config, 150, 150); |
| 56 bitmap.allocPixels(); | 56 bitmap.allocPixels(); |
| 57 bitmap.eraseRGB(0, 255, 0); | 57 bitmap.eraseARGB(255, 0, 255, 0); |
| 58 thumbnail_ = gfx::ImageSkia::CreateFrom1xBitmap(bitmap); | 58 thumbnail_ = gfx::ImageSkia::CreateFrom1xBitmap(bitmap); |
| 59 } | 59 } |
| 60 | 60 |
| 61 int FakeDesktopMediaList::GetSourceCount() const { return sources_.size(); } | 61 int FakeDesktopMediaList::GetSourceCount() const { return sources_.size(); } |
| 62 | 62 |
| 63 const DesktopMediaList::Source& FakeDesktopMediaList::GetSource( | 63 const DesktopMediaList::Source& FakeDesktopMediaList::GetSource( |
| 64 int index) const { | 64 int index) const { |
| 65 return sources_[index]; | 65 return sources_[index]; |
| 66 } | 66 } |
| OLD | NEW |