summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--chrome/app/generated_resources.grd13
-rw-r--r--chrome/browser/google/google_url_tracker.cc33
-rw-r--r--chrome/browser/google/google_url_tracker.h7
-rw-r--r--chrome/browser/ui/webui/conflicts_ui.cc2
4 files changed, 43 insertions, 12 deletions
diff --git a/chrome/app/generated_resources.grd b/chrome/app/generated_resources.grd
index 56681ed..803374d 100644
--- a/chrome/app/generated_resources.grd
+++ b/chrome/app/generated_resources.grd
@@ -4519,9 +4519,6 @@ Keep your key file in a safe place. You will need it to create new versions of y
<message name="IDS_CONFLICTS_EXPLANATION_TEXT" desc="The text blurb explaining what the compatibility page is.">
This page lists all modules loaded into the main process and modules registered to load at a later point.
</message>
- <message name="IDS_CONFLICTS_HELP_CENTER_LINK" desc="The text for the Help Center link.">
- Learn more
- </message>
<message name="IDS_CONFLICTS_CHECK_INVESTIGATING" desc="A label on the compatibility page saying we are investigating.">
We are currently investigating this issue.
</message>
@@ -13087,8 +13084,14 @@ Keep your key file in a safe place. You will need it to create new versions of y
</if>
<!-- GoogleURL tracker info bar -->
- <message name="IDS_GOOGLE_URL_TRACKER_INFOBAR_MESSAGE" desc="Message displayed when the user's current Google TLD doesn't match the default for their location.">
- It looks like you've moved. Would you like to use <ph name="NEW_GOOGLE_URL">$1<ex>google.com</ex></ph>?
+ <message name="IDS_GOOGLE_URL_TRACKER_INFOBAR_MESSAGE" desc="Message displayed when the user's current Google TLD doesn't match the default for their location. This can be shortened in other languages (e.g. by removing 'would you like to') as needed to keep the translated strings from being much longer than English, so the infobar can still display all three IDS_GOOGLE_URL_TRACKER_ strings and a 'Learn more' link.">
+ Would you like to search with <ph name="NEW_GOOGLE_HOST">$1<ex>google.de</ex></ph> instead of <ph name="CURRENT_GOOGLE_HOST">$2<ex>google.fr</ex></ph>?
+ </message>
+ <message name="IDS_GOOGLE_URL_TRACKER_INFOBAR_SWITCH" desc="Button text for button that changes user's default Google TLD to a new TLD.">
+ Switch to <ph name="NEW_GOOGLE_HOST">$1<ex>google.de</ex></ph>
+ </message>
+ <message name="IDS_GOOGLE_URL_TRACKER_INFOBAR_DONT_SWITCH" desc="Button text for button that leaves user's default Google TLD unchanged.">
+ Keep using <ph name="CURRENT_GOOGLE_HOST">$1<ex>google.fr</ex></ph>
</message>
<message name="IDS_SPEECH_INPUT_BUBBLE_HEADING" desc="First line in the content area of the speech input bubble. Instructs the user that they can start speaking.">
diff --git a/chrome/browser/google/google_url_tracker.cc b/chrome/browser/google/google_url_tracker.cc
index ad87589..dd719fb 100644
--- a/chrome/browser/google/google_url_tracker.cc
+++ b/chrome/browser/google/google_url_tracker.cc
@@ -11,6 +11,7 @@
#include "base/string_util.h"
#include "base/utf_string_conversions.h"
#include "chrome/browser/browser_process.h"
+#include "chrome/browser/google/google_util.h"
#include "chrome/browser/prefs/pref_service.h"
#include "chrome/browser/search_engines/template_url.h"
#include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h"
@@ -21,6 +22,7 @@
#include "content/common/notification_service.h"
#include "grit/generated_resources.h"
#include "net/base/load_flags.h"
+#include "net/base/net_util.h"
#include "net/url_request/url_request_context_getter.h"
#include "net/url_request/url_request_status.h"
#include "ui/base/l10n/l10n_util.h"
@@ -48,7 +50,8 @@ GoogleURLTrackerInfoBarDelegate::GoogleURLTrackerInfoBarDelegate(
const GURL& new_google_url)
: ConfirmInfoBarDelegate(tab_contents),
google_url_tracker_(google_url_tracker),
- new_google_url_(new_google_url) {
+ new_google_url_(new_google_url),
+ tab_contents_(tab_contents) {
}
bool GoogleURLTrackerInfoBarDelegate::Accept() {
@@ -62,21 +65,39 @@ bool GoogleURLTrackerInfoBarDelegate::Cancel() {
return true;
}
+string16 GoogleURLTrackerInfoBarDelegate::GetLinkText() const {
+ return l10n_util::GetStringUTF16(IDS_LEARN_MORE);
+}
+
+bool GoogleURLTrackerInfoBarDelegate::LinkClicked(
+ WindowOpenDisposition disposition) {
+ tab_contents_->OpenURL(google_util::AppendGoogleLocaleParam(GURL(
+ "https://www.google.com/support/chrome/bin/answer.py?answer=1618699")),
+ GURL(), (disposition == CURRENT_TAB) ? NEW_FOREGROUND_TAB : disposition,
+ PageTransition::LINK);
+ return false;
+}
+
GoogleURLTrackerInfoBarDelegate::~GoogleURLTrackerInfoBarDelegate() {
google_url_tracker_->InfoBarClosed();
}
string16 GoogleURLTrackerInfoBarDelegate::GetMessageText() const {
- // TODO(ukai): change new_google_url to google_base_domain?
return l10n_util::GetStringFUTF16(IDS_GOOGLE_URL_TRACKER_INFOBAR_MESSAGE,
- UTF8ToUTF16(new_google_url_.spec()));
+ GetHost(true), GetHost(false));
}
string16 GoogleURLTrackerInfoBarDelegate::GetButtonLabel(
InfoBarButton button) const {
- return l10n_util::GetStringUTF16((button == BUTTON_OK) ?
- IDS_CONFIRM_MESSAGEBOX_YES_BUTTON_LABEL :
- IDS_CONFIRM_MESSAGEBOX_NO_BUTTON_LABEL);
+ bool new_host = (button == BUTTON_OK);
+ return l10n_util::GetStringFUTF16(new_host ?
+ IDS_GOOGLE_URL_TRACKER_INFOBAR_SWITCH :
+ IDS_GOOGLE_URL_TRACKER_INFOBAR_DONT_SWITCH, GetHost(new_host));
+}
+
+string16 GoogleURLTrackerInfoBarDelegate::GetHost(bool new_host) const {
+ return net::StripWWW(UTF8ToUTF16(
+ (new_host ? new_google_url_ : google_url_tracker_->GoogleURL()).host()));
}
diff --git a/chrome/browser/google/google_url_tracker.h b/chrome/browser/google/google_url_tracker.h
index 96ba592..9e370ff 100644
--- a/chrome/browser/google/google_url_tracker.h
+++ b/chrome/browser/google/google_url_tracker.h
@@ -170,6 +170,8 @@ class GoogleURLTrackerInfoBarDelegate : public ConfirmInfoBarDelegate {
// ConfirmInfoBarDelegate:
virtual bool Accept() OVERRIDE;
virtual bool Cancel() OVERRIDE;
+ virtual string16 GetLinkText() const OVERRIDE;
+ virtual bool LinkClicked(WindowOpenDisposition disposition) OVERRIDE;
protected:
virtual ~GoogleURLTrackerInfoBarDelegate();
@@ -182,6 +184,11 @@ class GoogleURLTrackerInfoBarDelegate : public ConfirmInfoBarDelegate {
virtual string16 GetMessageText() const OVERRIDE;
virtual string16 GetButtonLabel(InfoBarButton button) const OVERRIDE;
+ // Returns the portion of the appropriate hostname to display.
+ string16 GetHost(bool new_host) const;
+
+ TabContents* tab_contents_;
+
DISALLOW_COPY_AND_ASSIGN(GoogleURLTrackerInfoBarDelegate);
};
diff --git a/chrome/browser/ui/webui/conflicts_ui.cc b/chrome/browser/ui/webui/conflicts_ui.cc
index 4c1d3ea..158bd25 100644
--- a/chrome/browser/ui/webui/conflicts_ui.cc
+++ b/chrome/browser/ui/webui/conflicts_ui.cc
@@ -45,7 +45,7 @@ ChromeWebUIDataSource* CreateConflictsUIHTMLSource() {
IDS_CONFLICTS_CHECK_WARNING_SUSPECTED);
source->AddLocalizedString("moduleConfirmedBad",
IDS_CONFLICTS_CHECK_WARNING_CONFIRMED);
- source->AddLocalizedString("helpCenterLink", IDS_CONFLICTS_HELP_CENTER_LINK);
+ source->AddLocalizedString("helpCenterLink", IDS_LEARN_MORE);
source->AddLocalizedString("investigatingText",
IDS_CONFLICTS_CHECK_INVESTIGATING);
source->AddLocalizedString("modulesNoneLoaded",