From bc123c060ad211a27ae4efd75670405a2f8cb495 Mon Sep 17 00:00:00 2001 From: "dpolukhin@chromium.org" Date: Tue, 15 Oct 2013 06:41:13 +0000 Subject: [PATCH] Update default app first run dialog to match new mocks + Remove button replaced with Cancel + Description removed from the dialog for security reasons + Changed heading and removed title for views BUG=296393 TEST=manual Review URL: https://codereview.chromium.org/26466006 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@228637 0039d316-1c4b-4281-b951-d872f2087c98 --- chrome/app/generated_resources.grd | 9 ++++++--- chrome/browser/extensions/extension_install_prompt.cc | 10 +++------- .../views/extensions/extension_install_dialog_view.cc | 19 ++++++++++++++----- 3 files changed, 23 insertions(+), 15 deletions(-) diff --git a/chrome/app/generated_resources.grd b/chrome/app/generated_resources.grd index 02716f873e97..bdfa09224a1d 100644 --- a/chrome/app/generated_resources.grd +++ b/chrome/app/generated_resources.grd @@ -3951,6 +3951,9 @@ Make sure you do not expose any sensitive information. Current Permissions + + Confirm Permissions + Add "$1Gmail Checker"? @@ -3975,6 +3978,9 @@ Make sure you do not expose any sensitive information. $1Gmail Checker + + Enable "$1Gmail Checker"? + @@ -5030,9 +5036,6 @@ Keep your key file in a safe place. You will need it to create new versions of y Remove from Chrome - - Remove app - (Disabled) diff --git a/chrome/browser/extensions/extension_install_prompt.cc b/chrome/browser/extensions/extension_install_prompt.cc index 1eb7171b559d..ae201f10348f 100644 --- a/chrome/browser/extensions/extension_install_prompt.cc +++ b/chrome/browser/extensions/extension_install_prompt.cc @@ -59,7 +59,7 @@ static const int kTitleIds[ExtensionInstallPrompt::NUM_PROMPT_TYPES] = { IDS_EXTENSION_PERMISSIONS_PROMPT_TITLE, IDS_EXTENSION_EXTERNAL_INSTALL_PROMPT_TITLE, IDS_EXTENSION_POST_INSTALL_PERMISSIONS_PROMPT_TITLE, - 0, // The prompt should be extension description. + IDS_EXTENSION_FIRST_RUN_PROMPT_TITLE, }; static const int kHeadingIds[ExtensionInstallPrompt::NUM_PROMPT_TYPES] = { IDS_EXTENSION_INSTALL_PROMPT_HEADING, @@ -69,7 +69,7 @@ static const int kHeadingIds[ExtensionInstallPrompt::NUM_PROMPT_TYPES] = { IDS_EXTENSION_PERMISSIONS_PROMPT_HEADING, 0, // External installs use different strings for extensions/apps. IDS_EXTENSION_POST_INSTALL_PERMISSIONS_PROMPT_HEADING, - 0, // First run dialog use the extension name. + IDS_EXTENSION_FIRST_RUN_PROMPT_HEADING, }; static const int kButtons[ExtensionInstallPrompt::NUM_PROMPT_TYPES] = { ui::DIALOG_BUTTON_OK | ui::DIALOG_BUTTON_CANCEL, @@ -99,7 +99,7 @@ static const int kAbortButtonIds[ExtensionInstallPrompt::NUM_PROMPT_TYPES] = { IDS_EXTENSION_PROMPT_PERMISSIONS_ABORT_BUTTON, IDS_EXTENSION_EXTERNAL_INSTALL_PROMPT_ABORT_BUTTON, IDS_CLOSE, - IDS_EXTENSION_PROMPT_FIRST_RUN_DECLINE_BUTTON + 0, // Platform dependent cancel button. }; static const int kPermissionsHeaderIds[ ExtensionInstallPrompt::NUM_PROMPT_TYPES] = { @@ -277,8 +277,6 @@ string16 ExtensionInstallPrompt::Prompt::GetDialogTitle() const { } else if (type_ == EXTERNAL_INSTALL_PROMPT) { return l10n_util::GetStringFUTF16( resource_id, UTF8ToUTF16(extension_->name())); - } else if (type_ == DEFAULT_INSTALL_FIRST_RUN_PROMPT) { - return UTF8ToUTF16(extension_->name()); } return l10n_util::GetStringUTF16(resource_id); @@ -298,8 +296,6 @@ string16 ExtensionInstallPrompt::Prompt::GetHeading() const { else resource_id = IDS_EXTENSION_EXTERNAL_INSTALL_PROMPT_HEADING_EXTENSION; return l10n_util::GetStringUTF16(resource_id); - } else if (type_ == DEFAULT_INSTALL_FIRST_RUN_PROMPT) { - return UTF8ToUTF16(extension_->description()); } else { return l10n_util::GetStringFUTF16( kHeadingIds[type_], UTF8ToUTF16(extension_->name())); diff --git a/chrome/browser/ui/views/extensions/extension_install_dialog_view.cc b/chrome/browser/ui/views/extensions/extension_install_dialog_view.cc index 59a9d0479548..5575e9f391d0 100644 --- a/chrome/browser/ui/views/extensions/extension_install_dialog_view.cc +++ b/chrome/browser/ui/views/extensions/extension_install_dialog_view.cc @@ -128,6 +128,10 @@ class ExtensionInstallDialogView : public views::DialogDelegateView, virtual void Layout() OVERRIDE; virtual gfx::Size GetPreferredSize() OVERRIDE; + // views::WidgetDelegate + virtual bool ShouldShowWindowTitle() const OVERRIDE; + virtual bool ShouldShowCloseButton() const OVERRIDE; + // views::LinkListener: virtual void LinkClicked(views::Link* source, int event_flags) OVERRIDE; @@ -417,10 +421,7 @@ ExtensionInstallDialogView::ExtensionInstallDialogView( icon_row_span = 4; } else if (prompt.ShouldShowPermissions()) { size_t permission_count = prompt.GetPermissionCount(); - if (is_first_run()) { - // In first run case we have separator. - icon_row_span = 1; - } else if (permission_count > 0) { + if (permission_count > 0) { // Also span the permission header and each of the permission rows (all // have a padding row above it). icon_row_span = 3 + permission_count * 2; @@ -490,7 +491,7 @@ ExtensionInstallDialogView::ExtensionInstallDialogView( layout->AddPaddingRow(0, views::kRelatedControlVerticalSpacing); if (prompt.GetPermissionCount() > 0) { - if (is_inline_install() || is_first_run()) { + if (is_inline_install()) { layout->StartRow(0, column_set_id); layout->AddView(new views::Separator(views::Separator::HORIZONTAL), 3, 1, views::GridLayout::FILL, views::GridLayout::FILL); @@ -707,6 +708,14 @@ gfx::Size ExtensionInstallDialogView::GetPreferredSize() { return dialog_size_; } +bool ExtensionInstallDialogView::ShouldShowWindowTitle() const { + return false; +} + +bool ExtensionInstallDialogView::ShouldShowCloseButton() const { + return false; +} + // static ExtensionInstallPrompt::ShowDialogCallback ExtensionInstallPrompt::GetDefaultShowDialogCallback() { -- 2.11.4.GIT