| OLD | NEW |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 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 #ifndef CHROME_BROWSER_UI_VIEWS_WEBSHARE_WEBSHARE_TARGET_PICKER_VIEW_H_ | 5 #ifndef CHROME_BROWSER_UI_VIEWS_WEBSHARE_WEBSHARE_TARGET_PICKER_VIEW_H_ |
| 6 #define CHROME_BROWSER_UI_VIEWS_WEBSHARE_WEBSHARE_TARGET_PICKER_VIEW_H_ | 6 #define CHROME_BROWSER_UI_VIEWS_WEBSHARE_WEBSHARE_TARGET_PICKER_VIEW_H_ |
| 7 | 7 |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/callback.h" | 10 #include "base/callback.h" |
| 11 #include "base/macros.h" | 11 #include "base/macros.h" |
| 12 #include "base/strings/string16.h" | 12 #include "base/strings/string16.h" |
| 13 #include "chrome/browser/ui/browser_dialogs.h" | 13 #include "chrome/browser/ui/browser_dialogs.h" |
| 14 #include "ui/base/ui_base_types.h" | 14 #include "ui/base/ui_base_types.h" |
| 15 #include "ui/views/controls/table/table_view_observer.h" | 15 #include "ui/views/controls/table/table_view_observer.h" |
| 16 #include "ui/views/window/dialog_delegate.h" | 16 #include "ui/views/window/dialog_delegate.h" |
| 17 | 17 |
| 18 class GURL; | 18 class GURL; |
| 19 class TargetPickerTableModel; | 19 class TargetPickerTableModel; |
| 20 | 20 |
| 21 namespace views { | 21 namespace views { |
| 22 class TableView; | 22 class TableView; |
| 23 } | 23 } |
| 24 | 24 |
| 25 namespace { | 25 namespace test { |
| 26 class WebShareTargetPickerViewTest; | 26 class WebShareTargetPickerViewTest; |
| 27 } | 27 } |
| 28 | 28 |
| 29 // Dialog that presents the user with a list of share target apps. Allows the | 29 // Dialog that presents the user with a list of share target apps. Allows the |
| 30 // user to pick one target to be opened and have data passed to it. | 30 // user to pick one target to be opened and have data passed to it. |
| 31 // | 31 // |
| 32 // NOTE: This dialog has *not* been UI-reviewed, and is being used by an | 32 // NOTE: This dialog has *not* been UI-reviewed, and is being used by an |
| 33 // in-development feature (Web Share) behind a runtime flag. It should not be | 33 // in-development feature (Web Share) behind a runtime flag. It should not be |
| 34 // used by any released code until going through UI review. | 34 // used by any released code until going through UI review. |
| 35 class WebShareTargetPickerView : public views::DialogDelegateView, | 35 class WebShareTargetPickerView : public views::DialogDelegateView, |
| (...skipping 21 matching lines...) Expand all Loading... |
| 57 bool Accept() override; | 57 bool Accept() override; |
| 58 base::string16 GetDialogButtonLabel(ui::DialogButton button) const override; | 58 base::string16 GetDialogButtonLabel(ui::DialogButton button) const override; |
| 59 bool IsDialogButtonEnabled(ui::DialogButton button) const override; | 59 bool IsDialogButtonEnabled(ui::DialogButton button) const override; |
| 60 | 60 |
| 61 // views::TableViewObserver overrides: | 61 // views::TableViewObserver overrides: |
| 62 void OnSelectionChanged() override; | 62 void OnSelectionChanged() override; |
| 63 void OnDoubleClick() override; | 63 void OnDoubleClick() override; |
| 64 | 64 |
| 65 private: | 65 private: |
| 66 // For access to |table_|. | 66 // For access to |table_|. |
| 67 friend class WebShareTargetPickerViewTest; | 67 friend class test::WebShareTargetPickerViewTest; |
| 68 | 68 |
| 69 views::TableView* table_ = nullptr; | 69 views::TableView* table_ = nullptr; |
| 70 | 70 |
| 71 const std::vector<std::pair<base::string16, GURL>> targets_; | 71 const std::vector<std::pair<base::string16, GURL>> targets_; |
| 72 std::unique_ptr<TargetPickerTableModel> table_model_; | 72 std::unique_ptr<TargetPickerTableModel> table_model_; |
| 73 | 73 |
| 74 base::Callback<void(base::Optional<std::string>)> close_callback_; | 74 base::Callback<void(base::Optional<std::string>)> close_callback_; |
| 75 | 75 |
| 76 DISALLOW_COPY_AND_ASSIGN(WebShareTargetPickerView); | 76 DISALLOW_COPY_AND_ASSIGN(WebShareTargetPickerView); |
| 77 }; | 77 }; |
| 78 | 78 |
| 79 #endif // CHROME_BROWSER_UI_VIEWS_WEBSHARE_WEBSHARE_TARGET_PICKER_VIEW_H_ | 79 #endif // CHROME_BROWSER_UI_VIEWS_WEBSHARE_WEBSHARE_TARGET_PICKER_VIEW_H_ |
| OLD | NEW |