| 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 "chrome/browser/media/webrtc/desktop_media_list.h" | 8 #include "chrome/browser/media/webrtc/desktop_media_list.h" |
| 9 #include "chrome/browser/ui/browser_dialogs.h" | 9 #include "chrome/browser/ui/browser_dialogs.h" |
| 10 #include "chrome/browser/ui/browser_finder.h" | 10 #include "chrome/browser/ui/browser_finder.h" |
| (...skipping 280 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 291 return list_views_[0]; | 291 return list_views_[0]; |
| 292 } | 292 } |
| 293 | 293 |
| 294 base::string16 DesktopMediaPickerDialogView::GetDialogButtonLabel( | 294 base::string16 DesktopMediaPickerDialogView::GetDialogButtonLabel( |
| 295 ui::DialogButton button) const { | 295 ui::DialogButton button) const { |
| 296 return l10n_util::GetStringUTF16(button == ui::DIALOG_BUTTON_OK | 296 return l10n_util::GetStringUTF16(button == ui::DIALOG_BUTTON_OK |
| 297 ? IDS_DESKTOP_MEDIA_PICKER_SHARE | 297 ? IDS_DESKTOP_MEDIA_PICKER_SHARE |
| 298 : IDS_CANCEL); | 298 : IDS_CANCEL); |
| 299 } | 299 } |
| 300 | 300 |
| 301 bool DesktopMediaPickerDialogView::ShouldDefaultButtonBeBlue() const { | |
| 302 return true; | |
| 303 } | |
| 304 | |
| 305 views::View* DesktopMediaPickerDialogView::CreateExtraView() { | 301 views::View* DesktopMediaPickerDialogView::CreateExtraView() { |
| 306 return audio_share_checkbox_; | 302 return audio_share_checkbox_; |
| 307 } | 303 } |
| 308 | 304 |
| 309 bool DesktopMediaPickerDialogView::Accept() { | 305 bool DesktopMediaPickerDialogView::Accept() { |
| 310 DesktopMediaSourceView* selection = | 306 DesktopMediaSourceView* selection = |
| 311 list_views_[pane_->GetSelectedTabIndex()]->GetSelection(); | 307 list_views_[pane_->GetSelectedTabIndex()]->GetSelection(); |
| 312 | 308 |
| 313 // Ok button should only be enabled when a source is selected. | 309 // Ok button should only be enabled when a source is selected. |
| 314 DCHECK(selection); | 310 DCHECK(selection); |
| (...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 440 // DesktopMediaPicker. | 436 // DesktopMediaPicker. |
| 441 content::BrowserThread::PostTask(content::BrowserThread::UI, FROM_HERE, | 437 content::BrowserThread::PostTask(content::BrowserThread::UI, FROM_HERE, |
| 442 base::BindOnce(callback_, source)); | 438 base::BindOnce(callback_, source)); |
| 443 callback_.Reset(); | 439 callback_.Reset(); |
| 444 } | 440 } |
| 445 | 441 |
| 446 // static | 442 // static |
| 447 std::unique_ptr<DesktopMediaPicker> DesktopMediaPicker::Create() { | 443 std::unique_ptr<DesktopMediaPicker> DesktopMediaPicker::Create() { |
| 448 return std::unique_ptr<DesktopMediaPicker>(new DesktopMediaPickerViews()); | 444 return std::unique_ptr<DesktopMediaPicker>(new DesktopMediaPickerViews()); |
| 449 } | 445 } |
| OLD | NEW |