Commit 7ee57b67 authored by hbono@chromium.org's avatar hbono@chromium.org

Add a "Learn More" link to the Spelling bubble.

This change adds a "Learn More" link to the Spelling bubble so we can open the "Exploring Chrome's privacy features" page as our "Under the Hood" page does.

BUG=103840
TEST=right click on a misspelled word.

Review URL: http://codereview.chromium.org/8561024

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@110906 0039d316-1c4b-4281-b951-d872f2087c98
parent 45c0bb1b
...@@ -493,6 +493,9 @@ are declared in build/common.gypi. ...@@ -493,6 +493,9 @@ are declared in build/common.gypi.
<message name="IDS_CONTENT_CONTEXT_SPELLING_BUBBLE_TEXT" desc="The text of a bubble that confirms users allows integrating the spelling service of Google to Chrome."> <message name="IDS_CONTENT_CONTEXT_SPELLING_BUBBLE_TEXT" desc="The text of a bubble that confirms users allows integrating the spelling service of Google to Chrome.">
Google Chrome can provide smarter spell-checking by sending what you type in the browser to Google servers, allowing you to use the same spell-checking technology used by Google search. Google Chrome can provide smarter spell-checking by sending what you type in the browser to Google servers, allowing you to use the same spell-checking technology used by Google search.
</message> </message>
<message name="IDS_CONTENT_CONTEXT_SPELLING_BUBBLE_LINK" desc="The link text of a bubble. This link opens the 'Exploring Chrome's privacy features' page.">
Learn More
</message>
<message name="IDS_CONTENT_CONTEXT_SPELLING_BUBBLE_ENABLE" desc="The button text that allows integrating the spelling service of Google."> <message name="IDS_CONTENT_CONTEXT_SPELLING_BUBBLE_ENABLE" desc="The button text that allows integrating the spelling service of Google.">
Enable Enable
</message> </message>
...@@ -705,6 +708,9 @@ are declared in build/common.gypi. ...@@ -705,6 +708,9 @@ are declared in build/common.gypi.
<message name="IDS_CONTENT_CONTEXT_SPELLING_BUBBLE_TEXT" desc="The text of a bubble that confirms users allows integrating the spelling service of Google to Chrome."> <message name="IDS_CONTENT_CONTEXT_SPELLING_BUBBLE_TEXT" desc="The text of a bubble that confirms users allows integrating the spelling service of Google to Chrome.">
Google Chrome can provide smarter spell-checking by sending what you type in the browser to Google servers, allowing you to use the same spell-checking technology used by Google search. Google Chrome can provide smarter spell-checking by sending what you type in the browser to Google servers, allowing you to use the same spell-checking technology used by Google search.
</message> </message>
<message name="IDS_CONTENT_CONTEXT_SPELLING_BUBBLE_LINK" desc="The link text of a bubble. This link opens the 'Google Chrome Privacy Notice' page.">
Learn More
</message>
<message name="IDS_CONTENT_CONTEXT_SPELLING_BUBBLE_ENABLE" desc="The button text that allows integrating the spelling service of Google."> <message name="IDS_CONTENT_CONTEXT_SPELLING_BUBBLE_ENABLE" desc="The button text that allows integrating the spelling service of Google.">
Enable Enable
</message> </message>
......
...@@ -5,9 +5,13 @@ ...@@ -5,9 +5,13 @@
#include "chrome/browser/tab_contents/spelling_bubble_model.h" #include "chrome/browser/tab_contents/spelling_bubble_model.h"
#include "base/logging.h" #include "base/logging.h"
#include "chrome/browser/google/google_util.h"
#include "chrome/browser/prefs/pref_service.h" #include "chrome/browser/prefs/pref_service.h"
#include "chrome/browser/profiles/profile.h" #include "chrome/browser/profiles/profile.h"
#include "chrome/browser/ui/browser_list.h"
#include "chrome/common/pref_names.h" #include "chrome/common/pref_names.h"
#include "chrome/common/url_constants.h"
#include "googleurl/src/gurl.h"
#include "grit/generated_resources.h" #include "grit/generated_resources.h"
#include "grit/theme_resources.h" #include "grit/theme_resources.h"
#include "ui/base/l10n/l10n_util.h" #include "ui/base/l10n/l10n_util.h"
...@@ -48,3 +52,14 @@ void SpellingBubbleModel::Accept() { ...@@ -48,3 +52,14 @@ void SpellingBubbleModel::Accept() {
void SpellingBubbleModel::Cancel() { void SpellingBubbleModel::Cancel() {
} }
string16 SpellingBubbleModel::GetLinkText() const {
return l10n_util::GetStringUTF16(IDS_CONTENT_CONTEXT_SPELLING_BUBBLE_LINK);
}
void SpellingBubbleModel::LinkClicked() {
Browser* browser = BrowserList::GetLastActiveWithProfile(profile_);
browser->OpenURL(
google_util::AppendGoogleLocaleParam(GURL(chrome::kPrivacyLearnMoreURL)),
GURL(), NEW_FOREGROUND_TAB, content::PAGE_TRANSITION_LINK);
}
...@@ -26,6 +26,8 @@ class SpellingBubbleModel : public ConfirmBubbleModel { ...@@ -26,6 +26,8 @@ class SpellingBubbleModel : public ConfirmBubbleModel {
virtual string16 GetButtonLabel(BubbleButton button) const OVERRIDE; virtual string16 GetButtonLabel(BubbleButton button) const OVERRIDE;
virtual void Accept() OVERRIDE; virtual void Accept() OVERRIDE;
virtual void Cancel() OVERRIDE; virtual void Cancel() OVERRIDE;
virtual string16 GetLinkText() const OVERRIDE;
virtual void LinkClicked() OVERRIDE;
private: private:
Profile* profile_; Profile* profile_;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment