diff options
author | johnnyg@chromium.org <johnnyg@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-07-14 01:31:08 +0000 |
---|---|---|
committer | johnnyg@chromium.org <johnnyg@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-07-14 01:31:08 +0000 |
commit | fd013932faa095a8384dd183874fe7a2ee6986d5 (patch) | |
tree | 306db0a979f401cea9faa42fbff0f8ed3abf11cc /chrome/browser/cocoa | |
parent | c41a4531e68a6acf979458001ae5adc76aadf39d (diff) | |
download | chromium_src-fd013932faa095a8384dd183874fe7a2ee6986d5.zip chromium_src-fd013932faa095a8384dd183874fe7a2ee6986d5.tar.gz chromium_src-fd013932faa095a8384dd183874fe7a2ee6986d5.tar.bz2 |
Privacy dashboard link for Mac. Only shown when --show-privacy-dashboard-link switch present.
XIB changes: added a new link to the sync group of the preferences dialog (required adding a continuation array). Slightly altered the spacing to fit.
BUG=48844
TEST=mac preferences pane with the above switch
Review URL: http://codereview.chromium.org/2891021
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@52258 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/cocoa')
-rw-r--r-- | chrome/browser/cocoa/preferences_window_controller.h | 2 | ||||
-rw-r--r-- | chrome/browser/cocoa/preferences_window_controller.mm | 14 |
2 files changed, 16 insertions, 0 deletions
diff --git a/chrome/browser/cocoa/preferences_window_controller.h b/chrome/browser/cocoa/preferences_window_controller.h index 3e80063..707f597 100644 --- a/chrome/browser/cocoa/preferences_window_controller.h +++ b/chrome/browser/cocoa/preferences_window_controller.h @@ -97,6 +97,7 @@ class ProfileSyncService; IBOutlet NSButton* syncCustomizeButton_; IBOutlet NSTextField* syncStatus_; IBOutlet NSButton* syncLink_; + IBOutlet NSButton* privacyDashboardLink_; scoped_nsobject<NSColor> syncStatusNoErrorBackgroundColor_; scoped_nsobject<NSColor> syncLinkNoErrorBackgroundColor_; scoped_nsobject<NSColor> syncErrorBackgroundColor_; @@ -146,6 +147,7 @@ class ProfileSyncService; - (IBAction)doSyncAction:(id)sender; - (IBAction)doSyncCustomize:(id)sender; - (IBAction)doSyncReauthentication:(id)sender; +- (IBAction)showPrivacyDashboard:(id)sender; - (IBAction)showSavedPasswords:(id)sender; - (IBAction)showAutoFillSettings:(id)sender; - (IBAction)importData:(id)sender; diff --git a/chrome/browser/cocoa/preferences_window_controller.mm b/chrome/browser/cocoa/preferences_window_controller.mm index 175835a..607a0d5 100644 --- a/chrome/browser/cocoa/preferences_window_controller.mm +++ b/chrome/browser/cocoa/preferences_window_controller.mm @@ -47,6 +47,7 @@ #include "chrome/browser/sync/profile_sync_service.h" #include "chrome/browser/sync/sync_ui_util.h" #include "chrome/browser/tab_contents/tab_contents.h" +#include "chrome/common/chrome_switches.h" #include "chrome/common/notification_details.h" #include "chrome/common/notification_observer.h" #include "chrome/common/notification_type.h" @@ -1274,6 +1275,15 @@ const int kDisabledIndex = 1; } } +// Called when the user clicks on the link to the privacy dashboard. +- (IBAction)showPrivacyDashboard:(id)sender { + Browser* browser = BrowserList::GetLastActive(); + + if (!browser || !browser->GetSelectedTabContents()) + browser = Browser::Create(profile_); + browser->OpenPrivacyDashboardTabAndActivate(); +} + // Called when the user clicks the "Customize Sync" button in the // "Personal Stuff" pane. Spawns a dialog-modal sheet that cleans // itself up on close. @@ -1750,6 +1760,10 @@ const int kDisabledIndex = 1; [syncStatus_ setBackgroundColor:syncStatusNoErrorBackgroundColor_]; [syncLinkCell setBackgroundColor:syncLinkNoErrorBackgroundColor_]; } + + if (!CommandLine::ForCurrentProcess()->HasSwitch( + switches::kShowPrivacyDashboardLink)) + [privacyDashboardLink_ setHidden:YES]; } // Show the preferences window. |