| 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 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 45 const int kListColumns = 3; | 45 const int kListColumns = 3; |
| 46 const int kTotalListWidth = kListColumns * kListItemWidth; | 46 const int kTotalListWidth = kListColumns * kListItemWidth; |
| 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) || defined(OS_ANDROID) |
| 56 // TODO(bshe): We may need to revisit this for Android platform. See |
| 57 // crbug.com/557424. |
| 56 return reinterpret_cast<DesktopMediaID::Id>(accelerated_widget); | 58 return reinterpret_cast<DesktopMediaID::Id>(accelerated_widget); |
| 57 #else | 59 #else |
| 58 return static_cast<DesktopMediaID::Id>(accelerated_widget); | 60 return static_cast<DesktopMediaID::Id>(accelerated_widget); |
| 59 #endif | 61 #endif |
| 60 } | 62 } |
| 61 | 63 |
| 62 int GetMediaListViewHeightForRows(size_t rows) { | 64 int GetMediaListViewHeightForRows(size_t rows) { |
| 63 return kListItemHeight * rows; | 65 return kListItemHeight * rows; |
| 64 } | 66 } |
| 65 | 67 |
| (...skipping 529 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 595 content::BrowserThread::PostTask( | 597 content::BrowserThread::PostTask( |
| 596 content::BrowserThread::UI, FROM_HERE, | 598 content::BrowserThread::UI, FROM_HERE, |
| 597 base::Bind(callback_, source)); | 599 base::Bind(callback_, source)); |
| 598 callback_.Reset(); | 600 callback_.Reset(); |
| 599 } | 601 } |
| 600 | 602 |
| 601 // static | 603 // static |
| 602 scoped_ptr<DesktopMediaPicker> DesktopMediaPicker::Create() { | 604 scoped_ptr<DesktopMediaPicker> DesktopMediaPicker::Create() { |
| 603 return scoped_ptr<DesktopMediaPicker>(new DesktopMediaPickerViews()); | 605 return scoped_ptr<DesktopMediaPicker>(new DesktopMediaPickerViews()); |
| 604 } | 606 } |
| OLD | NEW |