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

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

Issue 1503563004: Desktop chrome tab capture-chooseDesktopMedia() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: review round 3 Created 5 years 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
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/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 "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/strings/utf_string_conversions.h" 9 #include "base/strings/utf_string_conversions.h"
10 #include "chrome/browser/media/desktop_media_list.h" 10 #include "chrome/browser/media/desktop_media_list.h"
(...skipping 503 matching lines...) Expand 10 before | Expand all | Expand 10 after
514 bool DesktopMediaPickerDialogView::Accept() { 514 bool DesktopMediaPickerDialogView::Accept() {
515 DesktopMediaSourceView* selection = list_view_->GetSelection(); 515 DesktopMediaSourceView* selection = list_view_->GetSelection();
516 516
517 // Ok button should only be enabled when a source is selected. 517 // Ok button should only be enabled when a source is selected.
518 DCHECK(selection); 518 DCHECK(selection);
519 519
520 DesktopMediaID source; 520 DesktopMediaID source;
521 if (selection) 521 if (selection)
522 source = selection->source_id(); 522 source = selection->source_id();
523 523
524 if (parent_) 524 // Temporarily block tab capture.
525 // Tab capture will be enabled by next CL for it.
msw 2015/12/15 21:30:09 nit: remove this line; maybe note something simila
GeorgeZ 2015/12/16 00:07:39 Done.
526 if (parent_ && source.type != DesktopMediaID::TYPE_TAB)
525 parent_->NotifyDialogResult(source); 527 parent_->NotifyDialogResult(source);
526 528
527 // Return true to close the window. 529 // Return true to close the window.
528 return true; 530 return true;
529 } 531 }
530 532
531 void DesktopMediaPickerDialogView::DeleteDelegate() { 533 void DesktopMediaPickerDialogView::DeleteDelegate() {
532 // If the dialog is being closed then notify the parent about it. 534 // If the dialog is being closed then notify the parent about it.
533 if (parent_) 535 if (parent_)
534 parent_->NotifyDialogResult(DesktopMediaID()); 536 parent_->NotifyDialogResult(DesktopMediaID());
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
600 content::BrowserThread::PostTask( 602 content::BrowserThread::PostTask(
601 content::BrowserThread::UI, FROM_HERE, 603 content::BrowserThread::UI, FROM_HERE,
602 base::Bind(callback_, source)); 604 base::Bind(callback_, source));
603 callback_.Reset(); 605 callback_.Reset();
604 } 606 }
605 607
606 // static 608 // static
607 scoped_ptr<DesktopMediaPicker> DesktopMediaPicker::Create() { 609 scoped_ptr<DesktopMediaPicker> DesktopMediaPicker::Create() {
608 return scoped_ptr<DesktopMediaPicker>(new DesktopMediaPickerViews()); 610 return scoped_ptr<DesktopMediaPicker>(new DesktopMediaPickerViews());
609 } 611 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698