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 "chrome/browser/media/desktop_media_list.h" | 8 #include "chrome/browser/media/desktop_media_list.h" |
9 #include "chrome/browser/ui/ash/ash_util.h" | 9 #include "chrome/browser/ui/ash/ash_util.h" |
10 #include "chrome/browser/ui/views/constrained_window_views.h" | 10 #include "chrome/browser/ui/views/constrained_window_views.h" |
11 #include "chrome/grit/generated_resources.h" | 11 #include "chrome/grit/generated_resources.h" |
12 #include "components/web_modal/popup_manager.h" | 12 #include "components/web_modal/web_contents_modal_dialog_manager.h" |
13 #include "content/public/browser/browser_thread.h" | 13 #include "content/public/browser/browser_thread.h" |
14 #include "content/public/browser/web_contents.h" | 14 #include "content/public/browser/web_contents.h" |
15 #include "content/public/browser/web_contents_delegate.h" | 15 #include "content/public/browser/web_contents_delegate.h" |
16 #include "ui/aura/window_tree_host.h" | 16 #include "ui/aura/window_tree_host.h" |
17 #include "ui/base/l10n/l10n_util.h" | 17 #include "ui/base/l10n/l10n_util.h" |
18 #include "ui/events/event_constants.h" | 18 #include "ui/events/event_constants.h" |
19 #include "ui/events/keycodes/keyboard_codes.h" | 19 #include "ui/events/keycodes/keyboard_codes.h" |
20 #include "ui/gfx/canvas.h" | 20 #include "ui/gfx/canvas.h" |
21 #include "ui/native_theme/native_theme.h" | 21 #include "ui/native_theme/native_theme.h" |
22 #include "ui/views/background.h" | 22 #include "ui/views/background.h" |
(...skipping 391 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
414 | 414 |
415 if (dialog_window_id == 0) { | 415 if (dialog_window_id == 0) { |
416 dialog_window_id = AcceleratedWidgetToDesktopMediaId( | 416 dialog_window_id = AcceleratedWidgetToDesktopMediaId( |
417 widget->GetNativeWindow()->GetHost()->GetAcceleratedWidget()); | 417 widget->GetNativeWindow()->GetHost()->GetAcceleratedWidget()); |
418 } | 418 } |
419 } | 419 } |
420 | 420 |
421 list_view_->StartUpdating(dialog_window_id); | 421 list_view_->StartUpdating(dialog_window_id); |
422 | 422 |
423 if (modal_dialog) { | 423 if (modal_dialog) { |
424 web_modal::PopupManager* popup_manager = | 424 web_modal::WebContentsModalDialogManager* manager = |
425 web_modal::PopupManager::FromWebContents(parent_web_contents); | 425 web_modal::WebContentsModalDialogManager::FromWebContents( |
426 popup_manager->ShowModalDialog(GetWidget()->GetNativeView(), | 426 parent_web_contents); |
427 parent_web_contents); | 427 manager->ShowModalDialog(widget->GetNativeView()); |
428 } else { | 428 } else { |
429 widget->Show(); | 429 widget->Show(); |
430 } | 430 } |
431 } | 431 } |
432 | 432 |
433 DesktopMediaPickerDialogView::~DesktopMediaPickerDialogView() {} | 433 DesktopMediaPickerDialogView::~DesktopMediaPickerDialogView() {} |
434 | 434 |
435 void DesktopMediaPickerDialogView::DetachParent() { | 435 void DesktopMediaPickerDialogView::DetachParent() { |
436 parent_ = NULL; | 436 parent_ = NULL; |
437 } | 437 } |
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
570 content::BrowserThread::PostTask( | 570 content::BrowserThread::PostTask( |
571 content::BrowserThread::UI, FROM_HERE, | 571 content::BrowserThread::UI, FROM_HERE, |
572 base::Bind(callback_, source)); | 572 base::Bind(callback_, source)); |
573 callback_.Reset(); | 573 callback_.Reset(); |
574 } | 574 } |
575 | 575 |
576 // static | 576 // static |
577 scoped_ptr<DesktopMediaPicker> DesktopMediaPicker::Create() { | 577 scoped_ptr<DesktopMediaPicker> DesktopMediaPicker::Create() { |
578 return scoped_ptr<DesktopMediaPicker>(new DesktopMediaPickerViews()); | 578 return scoped_ptr<DesktopMediaPicker>(new DesktopMediaPickerViews()); |
579 } | 579 } |
OLD | NEW |