| OLD | NEW |
| (Empty) |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef CHROME_BROWSER_UI_VIEWS_EXTENSIONS_DEVICE_PERMISSIONS_DIALOG_VIEW_H_ | |
| 6 #define CHROME_BROWSER_UI_VIEWS_EXTENSIONS_DEVICE_PERMISSIONS_DIALOG_VIEW_H_ | |
| 7 | |
| 8 #include "extensions/browser/api/device_permissions_prompt.h" | |
| 9 #include "ui/views/controls/table/table_view_observer.h" | |
| 10 #include "ui/views/window/dialog_delegate.h" | |
| 11 | |
| 12 namespace views { | |
| 13 class TableView; | |
| 14 } | |
| 15 | |
| 16 class DevicePermissionsTableModel; | |
| 17 | |
| 18 // Displays a device permissions selector prompt as a modal dialog constrained | |
| 19 // to the window/tab displaying the given web contents. | |
| 20 class DevicePermissionsDialogView : public views::DialogDelegateView, | |
| 21 public views::TableViewObserver { | |
| 22 public: | |
| 23 DevicePermissionsDialogView( | |
| 24 scoped_refptr<extensions::DevicePermissionsPrompt::Prompt> prompt); | |
| 25 ~DevicePermissionsDialogView() override; | |
| 26 | |
| 27 // views::DialogDelegateView: | |
| 28 base::string16 GetDialogButtonLabel(ui::DialogButton button) const override; | |
| 29 bool IsDialogButtonEnabled(ui::DialogButton button) const override; | |
| 30 ui::ModalType GetModalType() const override; | |
| 31 base::string16 GetWindowTitle() const override; | |
| 32 void DeleteDelegate() override; | |
| 33 bool Accept() override; | |
| 34 gfx::Size GetPreferredSize() const override; | |
| 35 | |
| 36 // views::TableViewObserver: | |
| 37 void OnSelectionChanged() override; | |
| 38 | |
| 39 private: | |
| 40 scoped_refptr<extensions::DevicePermissionsPrompt::Prompt> prompt_; | |
| 41 | |
| 42 // Displays the list of devices. | |
| 43 views::TableView* table_view_; | |
| 44 std::unique_ptr<DevicePermissionsTableModel> table_model_; | |
| 45 }; | |
| 46 | |
| 47 #endif // CHROME_BROWSER_UI_VIEWS_EXTENSIONS_DEVICE_PERMISSIONS_DIALOG_VIEW_H_ | |
| OLD | NEW |