summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoratwilson@chromium.org <atwilson@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-08-28 06:16:31 +0000
committeratwilson@chromium.org <atwilson@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-08-28 06:16:31 +0000
commit6afd74351ab5174fb3ca326bfc39e8acccd70306 (patch)
tree991d00ebd82bfaf3d786c2a1cc9ce547cdfacc10
parentcc7352f88ee0cb7f66be4b1d76dc288fff923fca (diff)
downloadchromium_src-6afd74351ab5174fb3ca326bfc39e8acccd70306.zip
chromium_src-6afd74351ab5174fb3ca326bfc39e8acccd70306.tar.gz
chromium_src-6afd74351ab5174fb3ca326bfc39e8acccd70306.tar.bz2
Hide mac background mode prefs ui if background mode is not enabled.
Change to Preferences.xib: Setup preferences_window_controller.mm as a referencing outlet for the background mode UI so we can hide it. BUG=53522 TEST=run chrome without --enable-background-mode, make sure associated prefs UI is not shown Review URL: http://codereview.chromium.org/3246004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@57779 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/app/nibs/Preferences.xib66
-rw-r--r--chrome/browser/cocoa/preferences_window_controller.h4
-rw-r--r--chrome/browser/cocoa/preferences_window_controller.mm9
3 files changed, 76 insertions, 3 deletions
diff --git a/chrome/app/nibs/Preferences.xib b/chrome/app/nibs/Preferences.xib
index b9d1d93..1ab2914 100644
--- a/chrome/app/nibs/Preferences.xib
+++ b/chrome/app/nibs/Preferences.xib
@@ -12,9 +12,9 @@
</object>
<object class="NSMutableArray" key="IBDocument.EditedObjectIDs">
<bool key="EncodedWithXMLCoder">YES</bool>
- <integer value="482"/>
- <integer value="74"/>
<integer value="79"/>
+ <integer value="74"/>
+ <integer value="482"/>
</object>
<object class="NSArray" key="IBDocument.PluginDependencies">
<bool key="EncodedWithXMLCoder">YES</bool>
@@ -3982,6 +3982,38 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA</bytes>
</object>
<int key="connectionID">733</int>
</object>
+ <object class="IBConnectionRecord">
+ <object class="IBOutletConnection" key="connection">
+ <string key="label">backgroundModeTitle_</string>
+ <reference key="source" ref="1001"/>
+ <reference key="destination" ref="499998551"/>
+ </object>
+ <int key="connectionID">752</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBOutletConnection" key="connection">
+ <string key="label">backgroundModeCheckbox_</string>
+ <reference key="source" ref="1001"/>
+ <reference key="destination" ref="913950857"/>
+ </object>
+ <int key="connectionID">753</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBOutletConnection" key="connection">
+ <string key="label">backgroundModeDescription_</string>
+ <reference key="source" ref="1001"/>
+ <reference key="destination" ref="802144138"/>
+ </object>
+ <int key="connectionID">754</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBOutletConnection" key="connection">
+ <string key="label">backgroundModeLearnMore_</string>
+ <reference key="source" ref="1001"/>
+ <reference key="destination" ref="1011623445"/>
+ </object>
+ <int key="connectionID">756</int>
+ </object>
</object>
<object class="IBMutableOrderedSet" key="objectRecords">
<object class="NSArray" key="orderedObjects">
@@ -5762,7 +5794,7 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA</bytes>
</object>
</object>
<nil key="sourceID"/>
- <int key="maxID">751</int>
+ <int key="maxID">756</int>
</object>
<object class="IBClassDescriber" key="IBDocument.Classes">
<object class="NSMutableArray" key="referencedPartialClassDescriptions">
@@ -6254,6 +6286,10 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA</bytes>
<object class="NSArray" key="dict.sortedKeys">
<bool key="EncodedWithXMLCoder">YES</bool>
<string>autoFillSettingsButton_</string>
+ <string>backgroundModeCheckbox_</string>
+ <string>backgroundModeDescription_</string>
+ <string>backgroundModeLearnMore_</string>
+ <string>backgroundModeTitle_</string>
<string>basicsGroupDefaultBrowser_</string>
<string>basicsGroupHomePage_</string>
<string>basicsGroupSearchEngine_</string>
@@ -6288,6 +6324,10 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA</bytes>
<object class="NSMutableArray" key="dict.values">
<bool key="EncodedWithXMLCoder">YES</bool>
<string>NSButton</string>
+ <string>NSButton</string>
+ <string>NSTextField</string>
+ <string>NSButton</string>
+ <string>NSTextField</string>
<string>NSArray</string>
<string>NSArray</string>
<string>NSArray</string>
@@ -6325,6 +6365,10 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA</bytes>
<object class="NSArray" key="dict.sortedKeys">
<bool key="EncodedWithXMLCoder">YES</bool>
<string>autoFillSettingsButton_</string>
+ <string>backgroundModeCheckbox_</string>
+ <string>backgroundModeDescription_</string>
+ <string>backgroundModeLearnMore_</string>
+ <string>backgroundModeTitle_</string>
<string>basicsGroupDefaultBrowser_</string>
<string>basicsGroupHomePage_</string>
<string>basicsGroupSearchEngine_</string>
@@ -6363,6 +6407,22 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA</bytes>
<string key="candidateClassName">NSButton</string>
</object>
<object class="IBToOneOutletInfo">
+ <string key="name">backgroundModeCheckbox_</string>
+ <string key="candidateClassName">NSButton</string>
+ </object>
+ <object class="IBToOneOutletInfo">
+ <string key="name">backgroundModeDescription_</string>
+ <string key="candidateClassName">NSTextField</string>
+ </object>
+ <object class="IBToOneOutletInfo">
+ <string key="name">backgroundModeLearnMore_</string>
+ <string key="candidateClassName">NSButton</string>
+ </object>
+ <object class="IBToOneOutletInfo">
+ <string key="name">backgroundModeTitle_</string>
+ <string key="candidateClassName">NSTextField</string>
+ </object>
+ <object class="IBToOneOutletInfo">
<string key="name">basicsGroupDefaultBrowser_</string>
<string key="candidateClassName">NSArray</string>
</object>
diff --git a/chrome/browser/cocoa/preferences_window_controller.h b/chrome/browser/cocoa/preferences_window_controller.h
index 7d4a0a0..6011364 100644
--- a/chrome/browser/cocoa/preferences_window_controller.h
+++ b/chrome/browser/cocoa/preferences_window_controller.h
@@ -131,6 +131,10 @@ class ProfileSyncService;
BOOL proxiesConfigureButtonEnabled_;
BOOL restoreButtonsEnabled_;
BOOL restoreURLsEnabled_;
+ IBOutlet NSTextField* backgroundModeTitle_;
+ IBOutlet NSButton* backgroundModeCheckbox_;
+ IBOutlet NSTextField* backgroundModeDescription_;
+ IBOutlet NSButton* backgroundModeLearnMore_;
BooleanPrefMember backgroundModeEnabled_;
}
diff --git a/chrome/browser/cocoa/preferences_window_controller.mm b/chrome/browser/cocoa/preferences_window_controller.mm
index c382603a..7c62797 100644
--- a/chrome/browser/cocoa/preferences_window_controller.mm
+++ b/chrome/browser/cocoa/preferences_window_controller.mm
@@ -534,6 +534,15 @@ class ManagedPrefsBannerState : public ManagedPrefsBannerBase {
RemoveViewFromView(underTheHoodContentView_, enableLoggingCheckbox_);
#endif // !defined(GOOGLE_CHROME_BUILD)
+ // If BackgroundMode is not enabled, hide the related prefs UI.
+ if (!CommandLine::ForCurrentProcess()->HasSwitch(
+ switches::kEnableBackgroundMode)) {
+ RemoveViewFromView(underTheHoodContentView_, backgroundModeTitle_);
+ RemoveViewFromView(underTheHoodContentView_, backgroundModeCheckbox_);
+ RemoveViewFromView(underTheHoodContentView_, backgroundModeDescription_);
+ RemoveViewFromView(underTheHoodContentView_, backgroundModeLearnMore_);
+ }
+
// There are four problem children within the groups:
// Basics - Default Browser
// Personal Stuff - Sync