diff options
author | mnissler@chromium.org <mnissler@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-08-24 11:21:55 +0000 |
---|---|---|
committer | mnissler@chromium.org <mnissler@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-08-24 11:21:55 +0000 |
commit | d6aa6b6b5ee96766e099ea83a897faea2ca784af (patch) | |
tree | 7e91f5330653924bdaeb29348c1758594999627e /chrome | |
parent | 770b9f870d45a9a0b6d033a1963ac2bb928eb060 (diff) | |
download | chromium_src-d6aa6b6b5ee96766e099ea83a897faea2ca784af.zip chromium_src-d6aa6b6b5ee96766e099ea83a897faea2ca784af.tar.gz chromium_src-d6aa6b6b5ee96766e099ea83a897faea2ca784af.tar.bz2 |
Implement policy for controlling "Show Home Button" preference.
Preferences.xib changes: Connect the Enabled pin of the "Show home button" checkbox to PreferencesWindowController's showHomeButtonEnabled @property.
BUG=49603
TEST=manual
Review URL: http://codereview.chromium.org/3171022
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@57167 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r-- | chrome/app/nibs/Preferences.xib | 16 | ||||
-rw-r--r-- | chrome/app/policy/windows/adm/en-US/chrome.adm | 15 | ||||
-rw-r--r-- | chrome/app/policy/windows/admx/chrome.admx | 12 | ||||
-rw-r--r-- | chrome/app/policy/windows/admx/en-US/chrome.adml | 7 | ||||
-rw-r--r-- | chrome/browser/cocoa/preferences_window_controller.h | 2 | ||||
-rw-r--r-- | chrome/browser/cocoa/preferences_window_controller.mm | 5 | ||||
-rw-r--r-- | chrome/browser/gtk/options/general_page_gtk.cc | 3 | ||||
-rw-r--r-- | chrome/browser/managed_prefs_banner_base.cc | 1 | ||||
-rw-r--r-- | chrome/browser/policy/configuration_policy_pref_store.cc | 2 | ||||
-rw-r--r-- | chrome/browser/policy/configuration_policy_provider.cc | 3 | ||||
-rw-r--r-- | chrome/browser/policy/configuration_policy_store.h | 1 | ||||
-rw-r--r-- | chrome/browser/views/options/general_page_view.cc | 2 | ||||
-rw-r--r-- | chrome/common/policy_constants.cc | 1 | ||||
-rw-r--r-- | chrome/common/policy_constants.h | 1 |
14 files changed, 69 insertions, 2 deletions
diff --git a/chrome/app/nibs/Preferences.xib b/chrome/app/nibs/Preferences.xib index 9ceed27..cbda12f 100644 --- a/chrome/app/nibs/Preferences.xib +++ b/chrome/app/nibs/Preferences.xib @@ -3826,6 +3826,22 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA</bytes> </object> <object class="IBConnectionRecord"> <object class="IBBindingConnection" key="connection"> + <string key="label">enabled: showHomeButtonEnabled</string> + <reference key="source" ref="136601899"/> + <reference key="destination" ref="1001"/> + <object class="NSNibBindingConnector" key="connector"> + <reference key="NSSource" ref="136601899"/> + <reference key="NSDestination" ref="1001"/> + <string key="NSLabel">enabled: showHomeButtonEnabled</string> + <string key="NSBinding">enabled</string> + <string key="NSKeyPath">showHomeButtonEnabled</string> + <int key="NSNibBindingConnectorVersion">2</int> + </object> + </object> + <int key="connectionID">716</int> + </object> + <object class="IBConnectionRecord"> + <object class="IBBindingConnection" key="connection"> <string key="label">enabled: proxiesConfigureButtonEnabled</string> <reference key="source" ref="383918134"/> <reference key="destination" ref="1001"/> diff --git a/chrome/app/policy/windows/adm/en-US/chrome.adm b/chrome/app/policy/windows/adm/en-US/chrome.adm index 3d9ac57..62f27f7 100644 --- a/chrome/app/policy/windows/adm/en-US/chrome.adm +++ b/chrome/app/policy/windows/adm/en-US/chrome.adm @@ -183,6 +183,17 @@ CLASS MACHINE END PART
END POLICY
+ POLICY !!ShowHomeButton
+ #if version >= 4
+ SUPPORTED !!SUPPORTED_WINXPSP2
+ #endif
+ EXPLAIN !!ShowHomeButton_Explain
+ VALUENAME "ShowHomeButton"
+ VALUEON NUMERIC 1
+ VALUEOFF NUMERIC 0
+ END POLICY
+
+
END CATEGORY
END CATEGORY
@@ -265,3 +276,7 @@ DisabledPluginsList="Comma-separated list of disabled plugins:" Sync="Disallow synchronization of data with Google"
Sync_Explain="Disallows data synchronization in Google Chrome using Google-hosted synchronization services and prevents users from changing this setting.\n\n\
If you enable this setting, users cannot change or override this setting in Google Chrome."
+ShowHomeButton="Show home button"
+ShowHomeButton_Explain="Controls whether the home button is shown on the browser toolbar.\n\n\
+If you enable this setting, the home button will always be shown.\n\n\
+If you disable this setting, the button will be hidden."
diff --git a/chrome/app/policy/windows/admx/chrome.admx b/chrome/app/policy/windows/admx/chrome.admx index a21099a..5d908c1 100644 --- a/chrome/app/policy/windows/admx/chrome.admx +++ b/chrome/app/policy/windows/admx/chrome.admx @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="utf-8"?>
<policyDefinitions revision="1.0" schemaVersion="1.0">
<policyNamespaces>
- <target prefix="fullarmor" namespace="FullArmor.1048238f-d493-4a5d-a728-16df06ed4ac5" />
+ <target prefix="fullarmor" namespace="FullArmor.0ed4732f-0cd4-46eb-884e-fd5e736e5a97" />
<using prefix="windows" namespace="Microsoft.Policies.Windows" />
</policyNamespaces>
<supersededAdm fileName="D:\src\chromium\src\chrome\app\policy\windows\adm\en-US\chrome.adm" />
@@ -167,5 +167,15 @@ <list id="ExtensionInstallWhitelistDesc" valuePrefix="" />
</elements>
</policy>
+ <policy name="ShowHomeButton" class="Machine" displayName="$(string.ShowHomeButton)" explainText="$(string.ShowHomeButton_Explain)" presentation="$(presentation.ShowHomeButton)" key="Software\Policies\Google\Chrome" valueName="ShowHomeButton">
+ <parentCategory ref="googlechrome" />
+ <supportedOn ref="SUPPORTED_WINXPSP2" />
+ <enabledValue>
+ <decimal value="1" />
+ </enabledValue>
+ <disabledValue>
+ <decimal value="0" />
+ </disabledValue>
+ </policy>
</policies>
</policyDefinitions>
\ No newline at end of file diff --git a/chrome/app/policy/windows/admx/en-US/chrome.adml b/chrome/app/policy/windows/admx/en-US/chrome.adml index 900d882..b082aec 100644 --- a/chrome/app/policy/windows/admx/en-US/chrome.adml +++ b/chrome/app/policy/windows/admx/en-US/chrome.adml @@ -109,6 +109,12 @@ If you enable this setting, the specified list of plugins is never used in Googl <string id="Sync_Explain">Disallows data synchronization in Google Chrome using Google-hosted synchronization services and prevents users from changing this setting.
If you enable this setting, users cannot change or override this setting in Google Chrome.</string>
+ <string id="ShowHomeButton">Show home button</string>
+ <string id="ShowHomeButton_Explain">Controls whether the home button is shown on the browser toolbar.
+
+If you enable this setting, the home button will always be shown.
+
+If you disable this setting, the button will be hidden.</string>
<string id="ADMXMigrator_UnresolvedString">ADMX Migrator encountered a string that is not present in the source ADM string table.</string>
<string id="ADMXMigrator_NoSupportedOn">ADMX Migrator encountered a policy that does not have a supportedOn value.</string>
</stringTable>
@@ -154,6 +160,7 @@ If you enable this setting, users cannot change or override this setting in Goog <presentation id="ExtensionInstallWhitelist">
<listBox refId="ExtensionInstallWhitelistDesc">Specify extension ids to excempt from the blacklist.</listBox>
</presentation>
+ <presentation id="ShowHomeButton" />
</presentationTable>
</resources>
</policyDefinitionResources>
\ No newline at end of file diff --git a/chrome/browser/cocoa/preferences_window_controller.h b/chrome/browser/cocoa/preferences_window_controller.h index ffb6c1c..239afe0 100644 --- a/chrome/browser/cocoa/preferences_window_controller.h +++ b/chrome/browser/cocoa/preferences_window_controller.h @@ -90,6 +90,7 @@ class ProfileSyncService; scoped_nsobject<SearchEngineListModel> searchEngineModel_; // Used when creating a new home page url to make the new cell editable. BOOL pendingSelectForEdit_; + BOOL showHomeButtonEnabled_; // User Data panel BooleanPrefMember askSavePasswords_; @@ -174,6 +175,7 @@ class ProfileSyncService; // Usable from cocoa bindings to hook up the custom home pages table. @property (nonatomic, readonly) CustomHomePagesModel* customPagesSource; @property (assign, nonatomic) BOOL proxiesConfigureButtonEnabled; +@property (assign, nonatomic) BOOL showHomeButtonEnabled; @end diff --git a/chrome/browser/cocoa/preferences_window_controller.mm b/chrome/browser/cocoa/preferences_window_controller.mm index f0e6aa0..30d8baf 100644 --- a/chrome/browser/cocoa/preferences_window_controller.mm +++ b/chrome/browser/cocoa/preferences_window_controller.mm @@ -418,6 +418,7 @@ class ManagedPrefsBannerState : public ManagedPrefsBannerBase { @implementation PreferencesWindowController +@synthesize showHomeButtonEnabled = showHomeButtonEnabled_; @synthesize proxiesConfigureButtonEnabled = proxiesConfigureButtonEnabled_; - (id)initWithProfile:(Profile*)profile initialPage:(OptionsPage)initialPage { @@ -492,6 +493,9 @@ class ManagedPrefsBannerState : public ManagedPrefsBannerBase { proxyPrefs_.reset( PrefSetObserver::CreateProxyPrefSetObserver(prefs_, observer_.get())); [self setProxiesConfigureButtonEnabled:!proxyPrefs_->IsManaged()]; + + // Initialize show home button checkbox enabled state. + [self setShowHomeButtonEnabled:!showHomeButton_.IsManaged()]; } return self; } @@ -899,6 +903,7 @@ class ManagedPrefsBannerState : public ManagedPrefsBannerBase { if (*prefName == prefs::kShowHomeButton) { [self setShowHomeButton:showHomeButton_.GetValue() ? YES : NO]; + [self setShowHomeButtonEnabled:!showHomeButton_.IsManaged()]; } } diff --git a/chrome/browser/gtk/options/general_page_gtk.cc b/chrome/browser/gtk/options/general_page_gtk.cc index ea3adc9..e47de50 100644 --- a/chrome/browser/gtk/options/general_page_gtk.cc +++ b/chrome/browser/gtk/options/general_page_gtk.cc @@ -182,6 +182,9 @@ void GeneralPageGtk::NotifyPrefChanged(const std::string* pref_name) { gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON(homepage_show_home_button_checkbox_), show_home_button_.GetValue()); + gtk_widget_set_sensitive( + homepage_show_home_button_checkbox_, + !show_home_button_.IsManaged()); } initializing_ = false; diff --git a/chrome/browser/managed_prefs_banner_base.cc b/chrome/browser/managed_prefs_banner_base.cc index 6836e0c..33b7e83 100644 --- a/chrome/browser/managed_prefs_banner_base.cc +++ b/chrome/browser/managed_prefs_banner_base.cc @@ -51,6 +51,7 @@ void ManagedPrefsBannerBase::Init(PrefService* local_state, case OPTIONS_PAGE_GENERAL: AddUserPref(prefs::kHomePage); AddUserPref(prefs::kHomePageIsNewTabPage); + AddUserPref(prefs::kShowHomeButton); break; case OPTIONS_PAGE_CONTENT: AddUserPref(prefs::kSyncManaged); diff --git a/chrome/browser/policy/configuration_policy_pref_store.cc b/chrome/browser/policy/configuration_policy_pref_store.cc index f606708..9b6eb11 100644 --- a/chrome/browser/policy/configuration_policy_pref_store.cc +++ b/chrome/browser/policy/configuration_policy_pref_store.cc @@ -109,6 +109,8 @@ const ConfigurationPolicyPrefStore::PolicyToPreferenceMapEntry prefs::kExtensionInstallAllowList}, { Value::TYPE_LIST, kPolicyExtensionInstallDenyList, prefs::kExtensionInstallDenyList}, + { Value::TYPE_BOOLEAN, kPolicyShowHomeButton, + prefs::kShowHomeButton }, }; const ConfigurationPolicyPrefStore::PolicyToPreferenceMapEntry diff --git a/chrome/browser/policy/configuration_policy_provider.cc b/chrome/browser/policy/configuration_policy_provider.cc index 748c3a2..54aedaa 100644 --- a/chrome/browser/policy/configuration_policy_provider.cc +++ b/chrome/browser/policy/configuration_policy_provider.cc @@ -54,6 +54,8 @@ const InternalPolicyValueMapEntry kPolicyValueMap[] = { Value::TYPE_LIST, policy::key::kExtensionInstallAllowList }, { ConfigurationPolicyStore::kPolicyExtensionInstallDenyList, Value::TYPE_LIST, policy::key::kExtensionInstallDenyList }, + { ConfigurationPolicyStore::kPolicyShowHomeButton, + Value::TYPE_BOOLEAN, policy::key::kShowHomeButton }, }; } // namespace @@ -82,4 +84,3 @@ void ConfigurationPolicyProvider::NotifyStoreOfPolicyChange() { Source<ConfigurationPolicyProvider>(this), NotificationService::NoDetails()); } - diff --git a/chrome/browser/policy/configuration_policy_store.h b/chrome/browser/policy/configuration_policy_store.h index 4f876fe..66bf006 100644 --- a/chrome/browser/policy/configuration_policy_store.h +++ b/chrome/browser/policy/configuration_policy_store.h @@ -34,6 +34,7 @@ class ConfigurationPolicyStore { kPolicyApplicationLocale, kPolicyExtensionInstallAllowList, kPolicyExtensionInstallDenyList, + kPolicyShowHomeButton, // A policy for allowing administrators to forcibly disable // specific plugins. This policy is a comma-separated list of diff --git a/chrome/browser/views/options/general_page_view.cc b/chrome/browser/views/options/general_page_view.cc index a65e7e8..00f0296 100644 --- a/chrome/browser/views/options/general_page_view.cc +++ b/chrome/browser/views/options/general_page_view.cc @@ -410,6 +410,8 @@ void GeneralPageView::NotifyPrefChanged(const std::string* pref_name) { if (!pref_name || *pref_name == prefs::kShowHomeButton) { homepage_show_home_button_checkbox_->SetChecked( show_home_button_.GetValue()); + homepage_show_home_button_checkbox_->SetEnabled( + !show_home_button_.IsManaged()); } } diff --git a/chrome/common/policy_constants.cc b/chrome/common/policy_constants.cc index 8f56108..1668d5f 100644 --- a/chrome/common/policy_constants.cc +++ b/chrome/common/policy_constants.cc @@ -33,6 +33,7 @@ const char kApplicationLocaleValue[] = "ApplicationLocaleValue"; const char kSyncDisabled[] = "SyncDisabled"; const char kExtensionInstallAllowList[] = "ExtensionInstallWhitelist"; const char kExtensionInstallDenyList[] = "ExtensionInstallBlacklist"; +const char kShowHomeButton[] = "ShowHomeButton"; } // namespace key diff --git a/chrome/common/policy_constants.h b/chrome/common/policy_constants.h index 591a9f1..df533d5 100644 --- a/chrome/common/policy_constants.h +++ b/chrome/common/policy_constants.h @@ -35,6 +35,7 @@ extern const char kApplicationLocaleValue[]; extern const char kSyncDisabled[]; extern const char kExtensionInstallAllowList[]; extern const char kExtensionInstallDenyList[]; +extern const char kShowHomeButton[]; } // namespace key |