diff options
author | jhawkins@chromium.org <jhawkins@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-04-07 01:16:00 +0000 |
---|---|---|
committer | jhawkins@chromium.org <jhawkins@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-04-07 01:16:00 +0000 |
commit | e60cb05d9a93eb36963062acacc4f09b773ff09c (patch) | |
tree | 5b04a5aad71a8a98d5c9a8eb4c40bb3665600d9d /chrome | |
parent | d94b5f4e912342758398b5c4e115a933e69424e3 (diff) | |
download | chromium_src-e60cb05d9a93eb36963062acacc4f09b773ff09c.zip chromium_src-e60cb05d9a93eb36963062acacc4f09b773ff09c.tar.gz chromium_src-e60cb05d9a93eb36963062acacc4f09b773ff09c.tar.bz2 |
AutoFill: Add a 'Learn more' link to the AutoFill InfoBar that contains a link
to the soon-to-be-created help page for AutoFill.
BUG=none
TEST=none
Review URL: http://codereview.chromium.org/1574018
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@43795 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r-- | chrome/app/generated_resources.grd | 3 | ||||
-rw-r--r-- | chrome/browser/autofill/autofill_infobar_delegate.cc | 15 | ||||
-rw-r--r-- | chrome/browser/autofill/autofill_infobar_delegate.h | 6 |
3 files changed, 24 insertions, 0 deletions
diff --git a/chrome/app/generated_resources.grd b/chrome/app/generated_resources.grd index 10d1eb4..2212477 100644 --- a/chrome/app/generated_resources.grd +++ b/chrome/app/generated_resources.grd @@ -5524,6 +5524,9 @@ Keep your key file in a safe place. You will need it to create new versions of y <message name="IDS_AUTOFILL_INFOBAR_DENY" desc="Text to show for the autofill request infobar deny button."> Nope </message> + <message name="IDS_AUTOFILL_INFOBAR_LEARN_MORE" desc="Text to show for the autofill request infobar Learn more link."> + Learn more + </message> <message name="IDS_AUTOFILL_DIALOG_TITLE" desc="The title of the AutoFill dialog."> AutoFill Profiles </message> diff --git a/chrome/browser/autofill/autofill_infobar_delegate.cc b/chrome/browser/autofill/autofill_infobar_delegate.cc index 05ffae4..59c3647 100644 --- a/chrome/browser/autofill/autofill_infobar_delegate.cc +++ b/chrome/browser/autofill/autofill_infobar_delegate.cc @@ -7,9 +7,11 @@ #include "app/l10n_util.h" #include "app/resource_bundle.h" #include "chrome/browser/autofill/autofill_manager.h" +#include "chrome/browser/browser.h" #include "chrome/browser/pref_service.h" #include "chrome/browser/profile.h" #include "chrome/browser/tab_contents/tab_contents.h" +#include "chrome/browser/tab_contents/tab_contents_delegate.h" #include "chrome/common/pref_names.h" #include "grit/chromium_strings.h" #include "grit/generated_resources.h" @@ -19,8 +21,10 @@ AutoFillInfoBarDelegate::AutoFillInfoBarDelegate(TabContents* tab_contents, AutoFillManager* host) : ConfirmInfoBarDelegate(tab_contents), + browser_(NULL), host_(host) { if (tab_contents) { + browser_ = tab_contents->delegate()->GetBrowser(); PrefService* prefs = tab_contents->profile()->GetPrefs(); prefs->SetBoolean(prefs::kAutoFillInfoBarShown, true); tab_contents->AddInfoBar(this); @@ -88,3 +92,14 @@ bool AutoFillInfoBarDelegate::Cancel() { } return true; } + +std::wstring AutoFillInfoBarDelegate::GetLinkText() { + return l10n_util::GetString(IDS_AUTOFILL_INFOBAR_LEARN_MORE); +} + +bool AutoFillInfoBarDelegate::LinkClicked(WindowOpenDisposition disposition) { + GURL url = + GURL("http://www.google.com/support/chrome/bin/answer.py?answer=142893"); + browser_->OpenURL(url, GURL(), NEW_FOREGROUND_TAB, PageTransition::TYPED); + return true; +} diff --git a/chrome/browser/autofill/autofill_infobar_delegate.h b/chrome/browser/autofill/autofill_infobar_delegate.h index 0410cfb..73a52a4 100644 --- a/chrome/browser/autofill/autofill_infobar_delegate.h +++ b/chrome/browser/autofill/autofill_infobar_delegate.h @@ -10,6 +10,7 @@ #include "chrome/browser/tab_contents/infobar_delegate.h" class AutoFillManager; +class Browser; class SkBitmap; class TabContents; @@ -31,8 +32,13 @@ class AutoFillInfoBarDelegate : public ConfirmInfoBarDelegate { ConfirmInfoBarDelegate::InfoBarButton button) const; virtual bool Accept(); virtual bool Cancel(); + virtual std::wstring GetLinkText(); + virtual bool LinkClicked(WindowOpenDisposition disposition); private: + // The browser. + Browser* browser_; + // The AutoFillManager that initiated this InfoBar. AutoFillManager* host_; |