diff options
author | tim@chromium.org <tim@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-07-12 18:35:53 +0000 |
---|---|---|
committer | tim@chromium.org <tim@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-07-12 18:35:53 +0000 |
commit | 5e7f0237e94bd78155547ac52c55923539193c93 (patch) | |
tree | a78c4e7a2d0489660c49675641a7678fbc4ea0e4 | |
parent | fe57c8c948f71b1990b91324870184d28ffd334f (diff) | |
download | chromium_src-5e7f0237e94bd78155547ac52c55923539193c93.zip chromium_src-5e7f0237e94bd78155547ac52c55923539193c93.tar.gz chromium_src-5e7f0237e94bd78155547ac52c55923539193c93.tar.bz2 |
Add link to privacy dashboard from sync options panel behind command line flag.
BUG=48844
TEST=Open options > Personal Stuff, see link to dashboard.
Review URL: http://codereview.chromium.org/2934010
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@52112 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | chrome/app/generated_resources.grd | 3 | ||||
-rw-r--r-- | chrome/app/resources/locale_settings.grd | 5 | ||||
-rw-r--r-- | chrome/browser/browser.cc | 6 | ||||
-rw-r--r-- | chrome/browser/browser.h | 1 | ||||
-rw-r--r-- | chrome/browser/views/options/content_page_view.cc | 26 | ||||
-rw-r--r-- | chrome/browser/views/options/content_page_view.h | 1 | ||||
-rw-r--r-- | chrome/common/chrome_switches.cc | 4 | ||||
-rw-r--r-- | chrome/common/chrome_switches.h | 1 |
8 files changed, 44 insertions, 3 deletions
diff --git a/chrome/app/generated_resources.grd b/chrome/app/generated_resources.grd index 63d54b9..d7ec7cd 100644 --- a/chrome/app/generated_resources.grd +++ b/chrome/app/generated_resources.grd @@ -6849,6 +6849,9 @@ Keep your key file in a safe place. You will need it to create new versions of y <message name="IDS_SYNC_RELOGIN_LINK_LABEL" desc="The text to display on in the hyperlink when the user needs to relogin to use sync."> Login again </message> + <message name="IDS_SYNC_PRIVACY_DASHBOARD_LINK_LABEL" desc="The label on a link that brings users to the Google Privacy Dashboard to control sync"> + Control sync from Google Privacy Dashboard + </message> <message name="IDS_SYNC_CUSTOMIZE_BUTTON_LABEL" desc="The text to display on the button to customize which data types the user is syncing."> Customize... </message> diff --git a/chrome/app/resources/locale_settings.grd b/chrome/app/resources/locale_settings.grd index 7d5753c..0c33843 100644 --- a/chrome/app/resources/locale_settings.grd +++ b/chrome/app/resources/locale_settings.grd @@ -537,6 +537,11 @@ https://tools.google.com/chrome/intl/[GRITLANGCODE]/themes/index.html </message> + <!-- The URL for the privacy dashboard. TODO(tim): bug 48844, need real link. --> + <message name="IDS_PRIVACY_DASHBOARD_URL" translateable="false"> + http://www.google.com + </message> + <!-- The URL for Google Chrome welcome page. This is used for the pre --> <!-- populated thumbnails. --> <message name="IDS_CHROME_WELCOME_URL" translateable="false"> diff --git a/chrome/browser/browser.cc b/chrome/browser/browser.cc index 832516c..24918de 100644 --- a/chrome/browser/browser.cc +++ b/chrome/browser/browser.cc @@ -1818,6 +1818,12 @@ void Browser::OpenThemeGalleryTabAndActivate() { window_->Activate(); } +void Browser::OpenPrivacyDashboardTabAndActivate() { + OpenURL(GURL(l10n_util::GetStringUTF8(IDS_PRIVACY_DASHBOARD_URL)), + GURL(), NEW_FOREGROUND_TAB, PageTransition::LINK); + window_->Activate(); +} + void Browser::OpenAutoFillHelpTabAndActivate() { OpenURL(GURL(l10n_util::GetStringUTF8(IDS_AUTOFILL_HELP_URL)), GURL(), NEW_FOREGROUND_TAB, PageTransition::LINK); diff --git a/chrome/browser/browser.h b/chrome/browser/browser.h index 6fdf25f..2577eb4 100644 --- a/chrome/browser/browser.h +++ b/chrome/browser/browser.h @@ -522,6 +522,7 @@ class Browser : public TabStripModelDelegate, // Used by the "Get themes" link in the options dialog. void OpenThemeGalleryTabAndActivate(); void OpenAutoFillHelpTabAndActivate(); + void OpenPrivacyDashboardTabAndActivate(); #if defined(OS_CHROMEOS) void OpenSystemOptionsDialog(); void OpenInternetOptionsDialog(); diff --git a/chrome/browser/views/options/content_page_view.cc b/chrome/browser/views/options/content_page_view.cc index 19eabfc..1d25651 100644 --- a/chrome/browser/views/options/content_page_view.cc +++ b/chrome/browser/views/options/content_page_view.cc @@ -73,6 +73,7 @@ ContentPageView::ContentPageView(Profile* profile) sync_status_label_(NULL), sync_start_stop_button_(NULL), sync_customize_button_(NULL), + privacy_dashboard_link_(NULL), sync_service_(NULL), OptionsPageView(profile) { if (profile->GetProfileSyncService()) { @@ -168,9 +169,16 @@ void ContentPageView::LinkActivated(views::Link* source, int event_flags) { BrowserList::GetLastActive()->OpenThemeGalleryTabAndActivate(); return; } - DCHECK_EQ(source, sync_action_link_); - DCHECK(sync_service_); - sync_service_->ShowLoginDialog(); + if (source == sync_action_link_) { + DCHECK(sync_service_); + sync_service_->ShowLoginDialog(); + return; + } + if (source == privacy_dashboard_link_) { + BrowserList::GetLastActive()->OpenPrivacyDashboardTabAndActivate(); + return; + } + NOTREACHED() << "Invalid link source."; } //////////////////////////////////////////////////////////////////////////////// @@ -431,6 +439,15 @@ void ContentPageView::InitSyncGroup() { sync_action_link_->set_collapse_when_hidden(true); sync_action_link_->SetController(this); + privacy_dashboard_link_ = new views::Link(); + privacy_dashboard_link_->set_collapse_when_hidden(true); + privacy_dashboard_link_->SetController(this); + privacy_dashboard_link_->SetText( + l10n_util::GetString(IDS_SYNC_PRIVACY_DASHBOARD_LINK_LABEL)); + privacy_dashboard_link_->SetVisible( + CommandLine::ForCurrentProcess()->HasSwitch( + switches::kShowPrivacyDashboardLink)); + sync_start_stop_button_ = new views::NativeButton(this, std::wstring()); sync_customize_button_ = new views::NativeButton(this, std::wstring()); @@ -458,6 +475,9 @@ void ContentPageView::InitSyncGroup() { layout->StartRow(0, single_column_view_set_id); layout->AddView(sync_start_stop_button_); layout->AddView(sync_customize_button_); + layout->AddPaddingRow(0, kRelatedControlVerticalSpacing); + layout->StartRow(0, single_column_view_set_id); + layout->AddView(privacy_dashboard_link_, 3, 1); sync_group_ = new OptionsGroupView(contents, l10n_util::GetString(IDS_SYNC_OPTIONS_GROUP_NAME), std::wstring(), true); diff --git a/chrome/browser/views/options/content_page_view.h b/chrome/browser/views/options/content_page_view.h index c3f9817..7574660 100644 --- a/chrome/browser/views/options/content_page_view.h +++ b/chrome/browser/views/options/content_page_view.h @@ -102,6 +102,7 @@ class ContentPageView : public OptionsPageView, views::Link* sync_action_link_; views::NativeButton* sync_start_stop_button_; views::NativeButton* sync_customize_button_; + views::Link* privacy_dashboard_link_; BooleanPrefMember ask_to_save_passwords_; BooleanPrefMember ask_to_save_form_autofill_; diff --git a/chrome/common/chrome_switches.cc b/chrome/common/chrome_switches.cc index 6140243..83caf08 100644 --- a/chrome/common/chrome_switches.cc +++ b/chrome/common/chrome_switches.cc @@ -807,6 +807,10 @@ const char kShowCompositedLayerBorders[] = "show-composited-layer-borders"; // and study painting behavior. const char kShowPaintRects[] = "show-paint-rects"; +// Whether to show the link to the Google Privacy Dashboard on the Sync options +// panel. +const char kShowPrivacyDashboardLink[] = "show-privacy-dashboard-link"; + // Change the DCHECKS to dump memory and continue instead of displaying error // dialog. This is valid only in Release mode when --enable-dcheck is // specified. diff --git a/chrome/common/chrome_switches.h b/chrome/common/chrome_switches.h index 97eb92d..87755e7 100644 --- a/chrome/common/chrome_switches.h +++ b/chrome/common/chrome_switches.h @@ -232,6 +232,7 @@ extern const char kServiceAccountLsid[]; extern const char kShowCompositedLayerBorders[]; extern const char kShowIcons[]; extern const char kShowPaintRects[]; +extern const char kShowPrivacyDashboardLink[]; extern const char kSilentDumpOnDCHECK[]; extern const char kSimpleDataSource[]; extern const char kSingleProcess[]; |