Chromium Code Reviews| Index: chrome/browser/ui/views/extensions/extension_install_dialog_view.h |
| diff --git a/chrome/browser/ui/views/extensions/extension_install_dialog_view.h b/chrome/browser/ui/views/extensions/extension_install_dialog_view.h |
| index fafb61249989c8a65d6fce04bc219cac229b0a8e..c1a8e85b40035ffe47538d2289508eed5e5f3081 100644 |
| --- a/chrome/browser/ui/views/extensions/extension_install_dialog_view.h |
| +++ b/chrome/browser/ui/views/extensions/extension_install_dialog_view.h |
| @@ -50,9 +50,12 @@ class ExtensionInstallDialogView : public views::DialogDelegateView, |
| // the contents of the DialogView. |
| const views::ScrollView* scroll_view() const { return scroll_view_; } |
| + static void SetInstallDelayForTesting(int timeout_in_ms); |
| + |
| private: |
| // views::View: |
| void OnNativeThemeChanged(const ui::NativeTheme* theme) override; |
| + void VisibilityChanged(views::View* starting_from, bool is_visible) override; |
| // views::DialogDelegateView: |
| int GetDialogButtons() const override; |
| @@ -64,6 +67,7 @@ class ExtensionInstallDialogView : public views::DialogDelegateView, |
| void Layout() override; |
| gfx::Size GetPreferredSize() const override; |
| views::View* CreateExtraView() override; |
| + bool IsDialogButtonEnabled(ui::DialogButton button) const override; |
| // views::LinkListener: |
| void LinkClicked(views::Link* source, int event_flags) override; |
| @@ -71,6 +75,9 @@ class ExtensionInstallDialogView : public views::DialogDelegateView, |
| // Initializes the dialog view, adding in permissions if they exist. |
| void InitView(); |
| + // Enables installs and updates the dialog buttons. |
|
Devlin
2017/03/31 22:21:41
nitty nit: Maybe "Enables the ['install'|'accept']
Ackerman
2017/04/01 01:48:37
Yeah, it's a little awkward. I will change it to e
|
| + void EnableInstall(); |
|
Devlin
2017/03/31 22:21:41
similarly, maybe Enable[Install|Accept]Button.
Ackerman
2017/04/01 01:48:37
Done.
|
| + |
| // Adds permissions of |perm_type| to the dialog view if they exist. |
| bool AddPermissions(views::GridLayout* layout, |
| ui::ResourceBundle& rb, |
| @@ -112,6 +119,12 @@ class ExtensionInstallDialogView : public views::DialogDelegateView, |
| // has been run. |
| bool handled_result_; |
| + // Used to delay the activation of the install button. |
| + base::OneShotTimer timer_; |
| + |
| + // Default to not allow installs. |
| + bool install_enabled_ = false; |
|
Devlin
2017/03/31 22:21:41
We should be consistent in our initialization of P
Ackerman
2017/04/01 01:48:37
Done.
|
| + |
| DISALLOW_COPY_AND_ASSIGN(ExtensionInstallDialogView); |
| }; |