Chromium Code Reviews| Index: chrome/browser/ui/views/desktop_capture/desktop_media_picker_views.h |
| diff --git a/chrome/browser/ui/views/desktop_media_picker_views.h b/chrome/browser/ui/views/desktop_capture/desktop_media_picker_views.h |
| similarity index 87% |
| copy from chrome/browser/ui/views/desktop_media_picker_views.h |
| copy to chrome/browser/ui/views/desktop_capture/desktop_media_picker_views.h |
| index ef6ff2693504d16f95ffb31e565f3ea7a23c83b0..a0fafe00729b08d68e03933504586a59cc98e36a 100644 |
| --- a/chrome/browser/ui/views/desktop_media_picker_views.h |
| +++ b/chrome/browser/ui/views/desktop_capture/desktop_media_picker_views.h |
| @@ -2,18 +2,21 @@ |
| // Use of this source code is governed by a BSD-style license that can be |
| // found in the LICENSE file. |
| -#ifndef CHROME_BROWSER_UI_VIEWS_DESKTOP_MEDIA_PICKER_VIEWS_H_ |
| -#define CHROME_BROWSER_UI_VIEWS_DESKTOP_MEDIA_PICKER_VIEWS_H_ |
| +#ifndef CHROME_BROWSER_UI_VIEWS_DESKTOP_CAPTURE_DESKTOP_MEDIA_PICKER_VIEWS_H_ |
| +#define CHROME_BROWSER_UI_VIEWS_DESKTOP_CAPTURE_DESKTOP_MEDIA_PICKER_VIEWS_H_ |
| #include "base/macros.h" |
| #include "chrome/browser/media/desktop_media_list_observer.h" |
| #include "chrome/browser/media/desktop_media_picker.h" |
| +#include "ui/views/controls/tabbed_pane/tabbed_pane_listener.h" |
| #include "ui/views/window/dialog_delegate.h" |
| namespace views { |
| class ImageView; |
| class Label; |
| +class LabelButton; |
|
msw
2016/05/02 23:49:58
Remove this.
qiangchen
2016/05/05 22:17:54
Done.
|
| class Checkbox; |
| +class TabbedPane; |
| } // namespace views |
| class DesktopMediaPickerDialogView; |
| @@ -112,7 +115,8 @@ class DesktopMediaSourceView : public views::View { |
| }; |
| // Dialog view used for DesktopMediaPickerViews. |
| -class DesktopMediaPickerDialogView : public views::DialogDelegateView { |
| +class DesktopMediaPickerDialogView : public views::DialogDelegateView, |
| + public views::TabbedPaneListener { |
| public: |
| DesktopMediaPickerDialogView(content::WebContents* parent_web_contents, |
| gfx::NativeWindow context, |
| @@ -132,8 +136,12 @@ class DesktopMediaPickerDialogView : public views::DialogDelegateView { |
| void OnSelectionChanged(); |
| void OnDoubleClick(); |
| + // Called by clicking pane tab buttons. |
|
msw
2016/05/02 23:49:58
Typically subclass function overrides are simply a
qiangchen
2016/05/05 22:17:54
Done.
|
| + void TabSelectedAt(int index) override; |
| + |
| // views::View overrides. |
| gfx::Size GetPreferredSize() const override; |
| + void Layout() override; |
| // views::DialogDelegateView overrides. |
| ui::ModalType GetModalType() const override; |
| @@ -141,6 +149,7 @@ class DesktopMediaPickerDialogView : public views::DialogDelegateView { |
| bool IsDialogButtonEnabled(ui::DialogButton button) const override; |
| views::View* GetInitiallyFocusedView() override; |
| base::string16 GetDialogButtonLabel(ui::DialogButton button) const override; |
| + bool ShouldDefaultButtonBeBlue() const override; |
|
msw
2016/05/02 23:49:58
Order just before GetDialogButtonLabel(), to match
qiangchen
2016/05/05 22:17:54
Done.
|
| bool Accept() override; |
| void DeleteDelegate() override; |
| @@ -148,20 +157,24 @@ class DesktopMediaPickerDialogView : public views::DialogDelegateView { |
| DesktopMediaListView* GetMediaListViewForTesting() const; |
| DesktopMediaSourceView* GetMediaSourceViewForTesting(int index) const; |
| + views::Checkbox* GetCheckboxForTesting() const; |
| + int GetIndexOfSourceTypeForTesting( |
| + content::DesktopMediaID::Type source_type) const; |
| + views::TabbedPane* GetPaneForTesting() const; |
| private: |
| + void SwitchSourceType(int index); |
|
msw
2016/05/02 23:49:58
nit: add a blank line after
qiangchen
2016/05/05 22:17:54
Done.
|
| DesktopMediaPickerViews* parent_; |
| base::string16 app_name_; |
| views::Label* description_label_; |
| - // |audio_share_checked_| records whether the user permits audio, when |
| - // |audio_share_checkbox_| is disabled. |
| views::Checkbox* audio_share_checkbox_; |
| - bool audio_share_checked_; |
| - views::ScrollView* sources_scroll_view_; |
| - DesktopMediaListView* sources_list_view_; |
| + views::TabbedPane* pane_; |
| + std::vector<views::ScrollView*> scroll_views_; |
| + std::vector<DesktopMediaListView*> list_views_; |
| + std::vector<content::DesktopMediaID::Type> source_types_; |
| DISALLOW_COPY_AND_ASSIGN(DesktopMediaPickerDialogView); |
| }; |
| @@ -201,4 +214,4 @@ class DesktopMediaPickerViews : public DesktopMediaPicker { |
| DISALLOW_COPY_AND_ASSIGN(DesktopMediaPickerViews); |
| }; |
| -#endif // CHROME_BROWSER_UI_VIEWS_DESKTOP_MEDIA_PICKER_VIEWS_H_ |
| +#endif // CHROME_BROWSER_UI_VIEWS_DESKTOP_CAPTURE_DESKTOP_MEDIA_PICKER_VIEWS_H_ |