| 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/ui/views/desktop_media_picker_views.h" | 5 #include "chrome/browser/ui/views/desktop_media_picker_views.h" |
| 6 | 6 |
| 7 #include "base/callback.h" | 7 #include "base/callback.h" |
| 8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
| 9 #include "base/strings/utf_string_conversions.h" | 9 #include "base/strings/utf_string_conversions.h" |
| 10 #include "chrome/browser/media/desktop_media_list.h" | 10 #include "chrome/browser/media/desktop_media_list.h" |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 47 | 47 |
| 48 const int kDesktopMediaSourceViewGroupId = 1; | 48 const int kDesktopMediaSourceViewGroupId = 1; |
| 49 | 49 |
| 50 const char kDesktopMediaSourceViewClassName[] = | 50 const char kDesktopMediaSourceViewClassName[] = |
| 51 "DesktopMediaPicker_DesktopMediaSourceView"; | 51 "DesktopMediaPicker_DesktopMediaSourceView"; |
| 52 | 52 |
| 53 DesktopMediaID::Id AcceleratedWidgetToDesktopMediaId( | 53 DesktopMediaID::Id AcceleratedWidgetToDesktopMediaId( |
| 54 gfx::AcceleratedWidget accelerated_widget) { | 54 gfx::AcceleratedWidget accelerated_widget) { |
| 55 #if defined(OS_WIN) | 55 #if defined(OS_WIN) |
| 56 return reinterpret_cast<DesktopMediaID::Id>(accelerated_widget); | 56 return reinterpret_cast<DesktopMediaID::Id>(accelerated_widget); |
| 57 #elif !defined(OS_ANDROID) |
| 58 return static_cast<DesktopMediaID::Id>(accelerated_widget); |
| 57 #else | 59 #else |
| 58 return static_cast<DesktopMediaID::Id>(accelerated_widget); | 60 assert(false); |
| 61 return static_cast<DesktopMediaID::Id>(0); |
| 59 #endif | 62 #endif |
| 60 } | 63 } |
| 61 | 64 |
| 62 int GetMediaListViewHeightForRows(size_t rows) { | 65 int GetMediaListViewHeightForRows(size_t rows) { |
| 63 return kListItemHeight * rows; | 66 return kListItemHeight * rows; |
| 64 } | 67 } |
| 65 | 68 |
| 66 } // namespace | 69 } // namespace |
| 67 | 70 |
| 68 DesktopMediaSourceView::DesktopMediaSourceView( | 71 DesktopMediaSourceView::DesktopMediaSourceView( |
| (...skipping 516 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 585 content::BrowserThread::PostTask( | 588 content::BrowserThread::PostTask( |
| 586 content::BrowserThread::UI, FROM_HERE, | 589 content::BrowserThread::UI, FROM_HERE, |
| 587 base::Bind(callback_, source)); | 590 base::Bind(callback_, source)); |
| 588 callback_.Reset(); | 591 callback_.Reset(); |
| 589 } | 592 } |
| 590 | 593 |
| 591 // static | 594 // static |
| 592 scoped_ptr<DesktopMediaPicker> DesktopMediaPicker::Create() { | 595 scoped_ptr<DesktopMediaPicker> DesktopMediaPicker::Create() { |
| 593 return scoped_ptr<DesktopMediaPicker>(new DesktopMediaPickerViews()); | 596 return scoped_ptr<DesktopMediaPicker>(new DesktopMediaPickerViews()); |
| 594 } | 597 } |
| OLD | NEW |