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 "base/callback.h" | 7 #include "base/callback.h" |
8 #include "chrome/browser/media/desktop_media_list.h" | 8 #include "chrome/browser/media/desktop_media_list.h" |
9 #include "chrome/browser/media/desktop_media_list_observer.h" | 9 #include "chrome/browser/media/desktop_media_list_observer.h" |
10 #include "chrome/browser/ui/ash/ash_util.h" | 10 #include "chrome/browser/ui/ash/ash_util.h" |
(...skipping 499 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
510 scroll_view_->SetContents(list_view_); | 510 scroll_view_->SetContents(list_view_); |
511 AddChildView(scroll_view_); | 511 AddChildView(scroll_view_); |
512 | 512 |
513 DialogDelegate::CreateDialogWidget(this, context, parent_window); | 513 DialogDelegate::CreateDialogWidget(this, context, parent_window); |
514 | 514 |
515 // DesktopMediaList needs to know the ID of the picker window which | 515 // DesktopMediaList needs to know the ID of the picker window which |
516 // matches the ID it gets from the OS. Depending on the OS and configuration | 516 // matches the ID it gets from the OS. Depending on the OS and configuration |
517 // we get this ID differently. | 517 // we get this ID differently. |
518 content::DesktopMediaID::Id dialog_window_id = 0; | 518 content::DesktopMediaID::Id dialog_window_id = 0; |
519 | 519 |
520 #if defined(USE_AURA) | |
521 | |
522 #if defined(USE_ASH) | 520 #if defined(USE_ASH) |
523 if (chrome::IsNativeWindowInAsh(GetWidget()->GetNativeWindow())) { | 521 if (chrome::IsNativeWindowInAsh(GetWidget()->GetNativeWindow())) { |
524 dialog_window_id = content::DesktopMediaID::RegisterAuraWindow( | 522 dialog_window_id = content::DesktopMediaID::RegisterAuraWindow( |
525 GetWidget()->GetNativeWindow()).id; | 523 GetWidget()->GetNativeWindow()).id; |
526 } else | 524 } else |
527 #endif | 525 #endif |
528 { | 526 { |
529 dialog_window_id = AcceleratedWidgetToDesktopMediaId( | 527 dialog_window_id = AcceleratedWidgetToDesktopMediaId( |
530 GetWidget()->GetNativeWindow()->GetHost()-> | 528 GetWidget()->GetNativeWindow()->GetHost()-> |
531 GetAcceleratedWidget()); | 529 GetAcceleratedWidget()); |
532 } | 530 } |
533 | 531 |
534 #else // defined(USE_AURA) | |
535 dialog_window_id = 0; | |
536 NOTIMPLEMENTED(); | |
537 #endif // !defined(USE_AURA) | |
538 | |
539 list_view_->StartUpdating(dialog_window_id); | 532 list_view_->StartUpdating(dialog_window_id); |
540 | 533 |
541 GetWidget()->Show(); | 534 GetWidget()->Show(); |
542 } | 535 } |
543 | 536 |
544 DesktopMediaPickerDialogView::~DesktopMediaPickerDialogView() {} | 537 DesktopMediaPickerDialogView::~DesktopMediaPickerDialogView() {} |
545 | 538 |
546 void DesktopMediaPickerDialogView::DetachParent() { | 539 void DesktopMediaPickerDialogView::DetachParent() { |
547 parent_ = NULL; | 540 parent_ = NULL; |
548 } | 541 } |
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
652 base::Bind(callback_, source)); | 645 base::Bind(callback_, source)); |
653 callback_.Reset(); | 646 callback_.Reset(); |
654 } | 647 } |
655 | 648 |
656 } // namespace | 649 } // namespace |
657 | 650 |
658 // static | 651 // static |
659 scoped_ptr<DesktopMediaPicker> DesktopMediaPicker::Create() { | 652 scoped_ptr<DesktopMediaPicker> DesktopMediaPicker::Create() { |
660 return scoped_ptr<DesktopMediaPicker>(new DesktopMediaPickerViews()); | 653 return scoped_ptr<DesktopMediaPicker>(new DesktopMediaPickerViews()); |
661 } | 654 } |
OLD | NEW |