| 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 <stddef.h> | 7 #include <stddef.h> |
| 8 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "base/callback.h" | 10 #include "base/callback.h" |
| (...skipping 505 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 516 bool DesktopMediaPickerDialogView::Accept() { | 516 bool DesktopMediaPickerDialogView::Accept() { |
| 517 DesktopMediaSourceView* selection = list_view_->GetSelection(); | 517 DesktopMediaSourceView* selection = list_view_->GetSelection(); |
| 518 | 518 |
| 519 // Ok button should only be enabled when a source is selected. | 519 // Ok button should only be enabled when a source is selected. |
| 520 DCHECK(selection); | 520 DCHECK(selection); |
| 521 | 521 |
| 522 DesktopMediaID source; | 522 DesktopMediaID source; |
| 523 if (selection) | 523 if (selection) |
| 524 source = selection->source_id(); | 524 source = selection->source_id(); |
| 525 | 525 |
| 526 if (parent_) | 526 // Disable tab capture. |
| 527 // TODO(gyzhou): remove the line of the code begins with if after tab capture |
| 528 // is implemented for javascript Navigator.getUserMedia(). |
| 529 if (parent_ && source.type != DesktopMediaID::TYPE_WEB_CONTENTS) |
| 527 parent_->NotifyDialogResult(source); | 530 parent_->NotifyDialogResult(source); |
| 528 | 531 |
| 529 // Return true to close the window. | 532 // Return true to close the window. |
| 530 return true; | 533 return true; |
| 531 } | 534 } |
| 532 | 535 |
| 533 void DesktopMediaPickerDialogView::DeleteDelegate() { | 536 void DesktopMediaPickerDialogView::DeleteDelegate() { |
| 534 // If the dialog is being closed then notify the parent about it. | 537 // If the dialog is being closed then notify the parent about it. |
| 535 if (parent_) | 538 if (parent_) |
| 536 parent_->NotifyDialogResult(DesktopMediaID()); | 539 parent_->NotifyDialogResult(DesktopMediaID()); |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 603 content::BrowserThread::PostTask( | 606 content::BrowserThread::PostTask( |
| 604 content::BrowserThread::UI, FROM_HERE, | 607 content::BrowserThread::UI, FROM_HERE, |
| 605 base::Bind(callback_, source)); | 608 base::Bind(callback_, source)); |
| 606 callback_.Reset(); | 609 callback_.Reset(); |
| 607 } | 610 } |
| 608 | 611 |
| 609 // static | 612 // static |
| 610 scoped_ptr<DesktopMediaPicker> DesktopMediaPicker::Create() { | 613 scoped_ptr<DesktopMediaPicker> DesktopMediaPicker::Create() { |
| 611 return scoped_ptr<DesktopMediaPicker>(new DesktopMediaPickerViews()); | 614 return scoped_ptr<DesktopMediaPicker>(new DesktopMediaPickerViews()); |
| 612 } | 615 } |
| OLD | NEW |