| 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/desktop_media_picker.h" | 5 #include "chrome/browser/media/desktop_media_picker.h" |
| 6 | 6 |
| 7 #include "ash/shell.h" | 7 #include "ash/shell.h" |
| 8 #include "base/callback.h" | 8 #include "base/callback.h" |
| 9 #include "chrome/browser/media/desktop_media_list.h" | 9 #include "chrome/browser/media/desktop_media_list.h" |
| 10 #include "chrome/browser/media/desktop_media_list_observer.h" | 10 #include "chrome/browser/media/desktop_media_list_observer.h" |
| (...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 207 DesktopMediaSourceView::DesktopMediaSourceView( | 207 DesktopMediaSourceView::DesktopMediaSourceView( |
| 208 DesktopMediaListView* parent, | 208 DesktopMediaListView* parent, |
| 209 DesktopMediaID source_id) | 209 DesktopMediaID source_id) |
| 210 : parent_(parent), | 210 : parent_(parent), |
| 211 source_id_(source_id), | 211 source_id_(source_id), |
| 212 image_view_(new views::ImageView()), | 212 image_view_(new views::ImageView()), |
| 213 label_(new views::Label()), | 213 label_(new views::Label()), |
| 214 selected_(false) { | 214 selected_(false) { |
| 215 AddChildView(image_view_); | 215 AddChildView(image_view_); |
| 216 AddChildView(label_); | 216 AddChildView(label_); |
| 217 set_focusable(true); | 217 SetFocusable(true); |
| 218 } | 218 } |
| 219 | 219 |
| 220 DesktopMediaSourceView::~DesktopMediaSourceView() {} | 220 DesktopMediaSourceView::~DesktopMediaSourceView() {} |
| 221 | 221 |
| 222 void DesktopMediaSourceView::SetName(const string16& name) { | 222 void DesktopMediaSourceView::SetName(const string16& name) { |
| 223 label_->SetText(name); | 223 label_->SetText(name); |
| 224 } | 224 } |
| 225 | 225 |
| 226 void DesktopMediaSourceView::SetThumbnail(const gfx::ImageSkia& thumbnail) { | 226 void DesktopMediaSourceView::SetThumbnail(const gfx::ImageSkia& thumbnail) { |
| 227 image_view_->SetImage(thumbnail); | 227 image_view_->SetImage(thumbnail); |
| (...skipping 393 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 621 base::Bind(callback_, source)); | 621 base::Bind(callback_, source)); |
| 622 callback_.Reset(); | 622 callback_.Reset(); |
| 623 } | 623 } |
| 624 | 624 |
| 625 } // namespace | 625 } // namespace |
| 626 | 626 |
| 627 // static | 627 // static |
| 628 scoped_ptr<DesktopMediaPicker> DesktopMediaPicker::Create() { | 628 scoped_ptr<DesktopMediaPicker> DesktopMediaPicker::Create() { |
| 629 return scoped_ptr<DesktopMediaPicker>(new DesktopMediaPickerViews()); | 629 return scoped_ptr<DesktopMediaPicker>(new DesktopMediaPickerViews()); |
| 630 } | 630 } |
| OLD | NEW |