Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 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_EXTENSIONS_DEVICE_PERMISSIONS_DIALOG_VIEW_H_ | 5 #ifndef CHROME_BROWSER_UI_VIEWS_EXTENSIONS_DEVICE_PERMISSIONS_DIALOG_VIEW_H_ |
| 6 #define CHROME_BROWSER_UI_VIEWS_EXTENSIONS_DEVICE_PERMISSIONS_DIALOG_VIEW_H_ | 6 #define CHROME_BROWSER_UI_VIEWS_EXTENSIONS_DEVICE_PERMISSIONS_DIALOG_VIEW_H_ |
| 7 | 7 |
| 8 #include "extensions/browser/api/device_permissions_prompt.h" | 8 #include "extensions/browser/api/device_permissions_prompt.h" |
| 9 #include "ui/views/window/dialog_delegate.h" | 9 #include "ui/views/window/dialog_delegate.h" |
| 10 | 10 |
| 11 namespace views { | 11 namespace views { |
| 12 class TableView; | 12 class TableView; |
| 13 } | 13 } |
| 14 | 14 |
| 15 class DevicePermissionsTableModel; | 15 class DevicePermissionsTableModel; |
| 16 | 16 |
| 17 // Displays a device permissions selector prompt as a modal dialog constrained | 17 // Displays a device permissions selector prompt as a modal dialog constrained |
| 18 // to the window/tab displaying the given web contents. | 18 // to the window/tab displaying the given web contents. |
| 19 class DevicePermissionsDialogView : public views::DialogDelegateView { | 19 class DevicePermissionsDialogView : public views::DialogDelegateView { |
| 20 public: | 20 public: |
| 21 DevicePermissionsDialogView( | 21 DevicePermissionsDialogView( |
| 22 scoped_refptr<extensions::DevicePermissionsPrompt::Prompt> prompt); | 22 scoped_refptr<extensions::DevicePermissionsPrompt::Prompt> prompt); |
| 23 ~DevicePermissionsDialogView() override; | 23 ~DevicePermissionsDialogView() override; |
| 24 | 24 |
| 25 // Overriding views::DialogDelegateView. | |
|
Peter Kasting
2015/04/20 21:33:33
Nit: While here:
Since this class only subclasses
Reilly Grant (use Gerrit)
2015/04/20 23:14:49
Done.
| |
| 26 void DeleteDelegate() override; | |
| 27 | |
| 25 // Overriding views::DialogDelegate. | 28 // Overriding views::DialogDelegate. |
| 26 bool Cancel() override; | |
| 27 bool Accept() override; | 29 bool Accept() override; |
| 28 | 30 |
| 29 // Overriding views::DialogModel. | 31 // Overriding views::DialogModel. |
| 30 base::string16 GetDialogButtonLabel(ui::DialogButton button) const override; | 32 base::string16 GetDialogButtonLabel(ui::DialogButton button) const override; |
| 31 | 33 |
| 32 // Overriding views::WidgetDelegate. | 34 // Overriding views::WidgetDelegate. |
| 33 ui::ModalType GetModalType() const override; | 35 ui::ModalType GetModalType() const override; |
| 34 base::string16 GetWindowTitle() const override; | 36 base::string16 GetWindowTitle() const override; |
| 35 | 37 |
| 36 // Overriding views::View | 38 // Overriding views::View |
| 37 gfx::Size GetPreferredSize() const override; | 39 gfx::Size GetPreferredSize() const override; |
| 38 | 40 |
| 39 private: | 41 private: |
| 40 scoped_refptr<extensions::DevicePermissionsPrompt::Prompt> prompt_; | 42 scoped_refptr<extensions::DevicePermissionsPrompt::Prompt> prompt_; |
| 41 | 43 |
| 42 // Displays the list of devices. | 44 // Displays the list of devices. |
| 43 views::TableView* table_view_; | 45 views::TableView* table_view_; |
| 44 scoped_ptr<DevicePermissionsTableModel> table_model_; | 46 scoped_ptr<DevicePermissionsTableModel> table_model_; |
| 45 }; | 47 }; |
| 46 | 48 |
| 47 #endif // CHROME_BROWSER_UI_VIEWS_EXTENSIONS_DEVICE_PERMISSIONS_DIALOG_VIEW_H_ | 49 #endif // CHROME_BROWSER_UI_VIEWS_EXTENSIONS_DEVICE_PERMISSIONS_DIALOG_VIEW_H_ |
| OLD | NEW |