Chromium Code Reviews| Index: chrome/browser/ui/views/webshare/webshare_target_picker_view.h |
| diff --git a/chrome/browser/ui/views/webshare/webshare_target_picker_view.h b/chrome/browser/ui/views/webshare/webshare_target_picker_view.h |
| index 324955ebf5d36df8916559983b0abb052a5de22e..0aba40bfdd4d7d4d5c140b712d3f866094f51df1 100644 |
| --- a/chrome/browser/ui/views/webshare/webshare_target_picker_view.h |
| +++ b/chrome/browser/ui/views/webshare/webshare_target_picker_view.h |
| @@ -13,6 +13,7 @@ |
| #include "chrome/browser/ui/browser_dialogs.h" |
| #include "ui/base/models/table_model.h" |
| #include "ui/base/ui_base_types.h" |
| +#include "ui/views/controls/table/table_view.h" |
| #include "ui/views/window/dialog_delegate.h" |
| // Dialog that presents the user with a list of share target apps. Allows the |
| @@ -24,12 +25,13 @@ |
| class WebShareTargetPickerView : public views::DialogDelegateView, |
| public ui::TableModel { |
| public: |
| - // |targets| is a list of app titles that will be shown in a list. Calls |
| - // |close_callback| with SHARE if an app was chosen, or CANCEL if the dialog |
| - // was cancelled. |
| + // |targets| is a list of app titles that will be shown in a list. If the user |
| + // picks a target, this calls |callback| with the manifest URL of the chosen |
| + // target, and returns null if the user cancelled the share. |
|
Matt Giuca
2017/02/01 07:04:33
s/and/or
constantina
2017/02/01 23:24:21
Done.
|
| WebShareTargetPickerView( |
| const std::vector<base::string16>& targets, |
| - const base::Callback<void(SharePickerResult)>& close_callback); |
| + const base::Callback<void(base::Optional<base::string16>)>& |
| + close_callback); |
| ~WebShareTargetPickerView() override; |
| // views::View overrides: |
| @@ -43,6 +45,7 @@ class WebShareTargetPickerView : public views::DialogDelegateView, |
| bool Cancel() override; |
| bool Accept() override; |
| base::string16 GetDialogButtonLabel(ui::DialogButton button) const override; |
| + bool IsDialogButtonEnabled(ui::DialogButton button) const override; |
| // ui::TableModel overrides: |
| int RowCount() override; |
| @@ -50,9 +53,11 @@ class WebShareTargetPickerView : public views::DialogDelegateView, |
| void SetObserver(ui::TableModelObserver* observer) override; |
| private: |
| + views::TableView* table_; |
| + |
| const std::vector<base::string16> targets_; |
| - base::Callback<void(SharePickerResult)> close_callback_; |
| + base::Callback<void(base::Optional<base::string16>)> close_callback_; |
| DISALLOW_COPY_AND_ASSIGN(WebShareTargetPickerView); |
| }; |