Chromium Code Reviews| Index: chrome/browser/ui/views/desktop_media_picker_views.h |
| diff --git a/chrome/browser/ui/views/desktop_media_picker_views.h b/chrome/browser/ui/views/desktop_media_picker_views.h |
| index ef6ff2693504d16f95ffb31e565f3ea7a23c83b0..5dbe03690d61f2c727875d5532999072c0f66a46 100644 |
| --- a/chrome/browser/ui/views/desktop_media_picker_views.h |
| +++ b/chrome/browser/ui/views/desktop_media_picker_views.h |
| @@ -8,11 +8,13 @@ |
| #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/button/button.h" |
| #include "ui/views/window/dialog_delegate.h" |
| namespace views { |
| class ImageView; |
| class Label; |
| +class LabelButton; |
| class Checkbox; |
| } // namespace views |
| @@ -112,7 +114,8 @@ class DesktopMediaSourceView : public views::View { |
| }; |
| // Dialog view used for DesktopMediaPickerViews. |
| -class DesktopMediaPickerDialogView : public views::DialogDelegateView { |
| +class DesktopMediaPickerDialogView : public views::DialogDelegateView, |
| + public views::ButtonListener { |
| public: |
| DesktopMediaPickerDialogView(content::WebContents* parent_web_contents, |
| gfx::NativeWindow context, |
| @@ -132,8 +135,12 @@ class DesktopMediaPickerDialogView : public views::DialogDelegateView { |
| void OnSelectionChanged(); |
| void OnDoubleClick(); |
| + // Called by clicking label buttons. |
| + void ButtonPressed(views::Button* sender, const ui::Event& event) override; |
| + |
| // views::View overrides. |
| gfx::Size GetPreferredSize() const override; |
| + void Layout() override; |
| // views::DialogDelegateView overrides. |
| ui::ModalType GetModalType() const override; |
| @@ -141,6 +148,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; |
| bool Accept() override; |
| void DeleteDelegate() override; |
| @@ -148,20 +156,24 @@ class DesktopMediaPickerDialogView : public views::DialogDelegateView { |
| DesktopMediaListView* GetMediaListViewForTesting() const; |
| DesktopMediaSourceView* GetMediaSourceViewForTesting(int index) const; |
| + views::Checkbox* GetCheckboxForTesting() const; |
| + views::LabelButton* GetSourceTypeButtonForTesting( |
| + content::DesktopMediaID::Type source_type) const; |
| private: |
| + void SwitchSourceType(int index); |
| 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_; |
| + std::vector<views::LabelButton*> source_type_buttons_; |
| + std::vector<views::ScrollView*> scroll_views_; |
| + std::vector<DesktopMediaListView*> list_views_; |
| + std::vector<content::DesktopMediaID::Type> source_types_; |
| + int current_index_; |
|
msw
2016/04/22 22:19:56
nit: current index of what? Maybe |current_source_
|
| DISALLOW_COPY_AND_ASSIGN(DesktopMediaPickerDialogView); |
| }; |