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_capture/desktop_media_picker_views.h" | 5 #include "chrome/browser/ui/views/desktop_capture/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 "chrome/browser/media/desktop_media_list.h" | 9 #include "chrome/browser/media/desktop_media_list.h" |
10 #include "chrome/browser/ui/browser_finder.h" | 10 #include "chrome/browser/ui/browser_finder.h" |
(...skipping 420 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
431 | 431 |
432 // Notify the |callback_| asynchronously because it may need to destroy | 432 // Notify the |callback_| asynchronously because it may need to destroy |
433 // DesktopMediaPicker. | 433 // DesktopMediaPicker. |
434 content::BrowserThread::PostTask(content::BrowserThread::UI, FROM_HERE, | 434 content::BrowserThread::PostTask(content::BrowserThread::UI, FROM_HERE, |
435 base::Bind(callback_, source)); | 435 base::Bind(callback_, source)); |
436 callback_.Reset(); | 436 callback_.Reset(); |
437 } | 437 } |
438 | 438 |
439 // static | 439 // static |
440 std::unique_ptr<DesktopMediaPicker> DesktopMediaPicker::Create() { | 440 std::unique_ptr<DesktopMediaPicker> DesktopMediaPicker::Create() { |
441 if (!base::CommandLine::ForCurrentProcess()->HasSwitch( | 441 if (base::CommandLine::ForCurrentProcess()->HasSwitch( |
442 extensions::switches::kDisableDesktopCapturePickerOldUI)) { | 442 extensions::switches::kDisableDesktopCapturePickerNewUI)) { |
443 return std::unique_ptr<DesktopMediaPicker>( | 443 return std::unique_ptr<DesktopMediaPicker>( |
444 new deprecated::DesktopMediaPickerViews()); | 444 new deprecated::DesktopMediaPickerViews()); |
445 } | 445 } |
446 return std::unique_ptr<DesktopMediaPicker>(new DesktopMediaPickerViews()); | 446 return std::unique_ptr<DesktopMediaPicker>(new DesktopMediaPickerViews()); |
447 } | 447 } |
OLD | NEW |