Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1016)

Side by Side Diff: chrome/browser/ui/views/desktop_media_picker_views.cc

Issue 338503007: Do not filter the picker window with Aura. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 547 matching lines...) Expand 10 before | Expand all | Expand 10 after
558 views::Widget* widget = NULL; 558 views::Widget* widget = NULL;
559 if (parent_web_contents) 559 if (parent_web_contents)
560 widget = CreateWebModalDialogViews(this, parent_web_contents); 560 widget = CreateWebModalDialogViews(this, parent_web_contents);
561 else 561 else
562 widget = DialogDelegate::CreateDialogWidget(this, context, parent_window); 562 widget = DialogDelegate::CreateDialogWidget(this, context, parent_window);
563 563
564 // DesktopMediaList needs to know the ID of the picker window which 564 // DesktopMediaList needs to know the ID of the picker window which
565 // matches the ID it gets from the OS. Depending on the OS and configuration 565 // matches the ID it gets from the OS. Depending on the OS and configuration
566 // we get this ID differently. 566 // we get this ID differently.
567 content::DesktopMediaID::Id dialog_window_id = 0; 567 content::DesktopMediaID::Id dialog_window_id = 0;
568
569 // If there is |parent_window| or |parent_web_contents|, the picker window
570 // is embedded in the parent and does not have its own native window id, so we
571 // do not filter in that case.
572 if (!parent_window && !parent_web_contents) {
Sergey Ulanov 2014/06/16 21:48:43 You need just !parent_web_contents. parent_window
jiayl 2014/06/16 22:07:34 That's not true. If the parent_web_contents is NUL
Sergey Ulanov 2014/06/16 22:14:00 Did you try it with Ash? I think with Ash you'll g
568 #if defined(USE_ASH) 573 #if defined(USE_ASH)
569 if (chrome::IsNativeWindowInAsh(widget->GetNativeWindow())) { 574 if (chrome::IsNativeWindowInAsh(widget->GetNativeWindow())) {
570 dialog_window_id = content::DesktopMediaID::RegisterAuraWindow( 575 dialog_window_id = content::DesktopMediaID::RegisterAuraWindow(
571 widget->GetNativeWindow()).id; 576 widget->GetNativeWindow()).id;
572 DCHECK_NE(dialog_window_id, 0); 577 DCHECK_NE(dialog_window_id, 0);
573 } 578 }
574 #endif 579 #endif
575 if (dialog_window_id == 0) { 580
576 dialog_window_id = AcceleratedWidgetToDesktopMediaId( 581 if (dialog_window_id == 0) {
577 widget->GetNativeWindow()->GetHost()->GetAcceleratedWidget()); 582 dialog_window_id = AcceleratedWidgetToDesktopMediaId(
583 widget->GetNativeWindow()->GetHost()->GetAcceleratedWidget());
584 }
578 } 585 }
579 586
580 list_view_->StartUpdating(dialog_window_id); 587 list_view_->StartUpdating(dialog_window_id);
581 588
582 if (parent_web_contents) { 589 if (parent_web_contents) {
583 web_modal::WebContentsModalDialogManager* manager = 590 web_modal::WebContentsModalDialogManager* manager =
584 web_modal::WebContentsModalDialogManager::FromWebContents( 591 web_modal::WebContentsModalDialogManager::FromWebContents(
585 parent_web_contents); 592 parent_web_contents);
586 manager->ShowModalDialog(widget->GetNativeView()); 593 manager->ShowModalDialog(widget->GetNativeView());
587 } else { 594 } else {
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after
724 base::Bind(callback_, source)); 731 base::Bind(callback_, source));
725 callback_.Reset(); 732 callback_.Reset();
726 } 733 }
727 734
728 } // namespace 735 } // namespace
729 736
730 // static 737 // static
731 scoped_ptr<DesktopMediaPicker> DesktopMediaPicker::Create() { 738 scoped_ptr<DesktopMediaPicker> DesktopMediaPicker::Create() {
732 return scoped_ptr<DesktopMediaPicker>(new DesktopMediaPickerViews()); 739 return scoped_ptr<DesktopMediaPicker>(new DesktopMediaPickerViews());
733 } 740 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698