Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3961)

Unified Diff: chrome/browser/ui/views/extensions/extension_install_dialog_view.h

Issue 2716353003: [Extensions UI] Initially disabled OK button for extension install prompts. (Closed)
Patch Set: Addressing Devlin's comments. Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/browser/ui/views/extensions/extension_install_dialog_view.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..0c52a3ee125c15c78eec814004b79507281dbc14 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 SetInstallButtonDelayForTesting(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 the install button and updates the dialog buttons.
+ void EnableInstallButton();
+
// 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_;
+
+ // Used to determine whether the install button should be enabled.
+ bool install_button_enabled_;
+
DISALLOW_COPY_AND_ASSIGN(ExtensionInstallDialogView);
};
« no previous file with comments | « no previous file | chrome/browser/ui/views/extensions/extension_install_dialog_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698