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