diff options
-rw-r--r-- | app/l10n_util.cc | 26 | ||||
-rwxr-xr-x[-rw-r--r--] | chrome/app/chrome_dll_main.cc | 9 | ||||
-rwxr-xr-x[-rw-r--r--] | chrome/app/policy/windows/adm/en-US/chrome.adm | 18 | ||||
-rw-r--r-- | chrome/app/policy/windows/admx/chrome.admx | 307 | ||||
-rw-r--r-- | chrome/app/policy/windows/admx/en-US/chrome.adml | 267 | ||||
-rw-r--r-- | chrome/browser/browser_main.cc | 2 | ||||
-rwxr-xr-x[-rw-r--r--] | chrome/browser/browser_main_mac.mm | 5 | ||||
-rwxr-xr-x[-rw-r--r--] | chrome/browser/chromeos/input_method/candidate_window.cc | 7 | ||||
-rwxr-xr-x[-rw-r--r--] | chrome/browser/chromeos/login/language_switch_menu.cc | 33 | ||||
-rw-r--r-- | chrome/browser/configuration_policy_pref_store.cc | 2 | ||||
-rw-r--r-- | chrome/browser/configuration_policy_provider.cc | 2 | ||||
-rw-r--r-- | chrome/browser/configuration_policy_store.h | 1 | ||||
-rw-r--r-- | chrome/browser/pref_service.cc | 8 | ||||
-rw-r--r-- | chrome/browser/pref_service.h | 4 |
14 files changed, 375 insertions, 316 deletions
diff --git a/app/l10n_util.cc b/app/l10n_util.cc index e50bbb8..9da76fc 100644 --- a/app/l10n_util.cc +++ b/app/l10n_util.cc @@ -381,14 +381,7 @@ std::string GetApplicationLocale(const std::wstring& pref_locale) { // to renderer and plugin processes so they know what language the parent // process decided to use. #if defined(OS_WIN) - // First, check to see if there's a --lang flag. - const CommandLine& parsed_command_line = *CommandLine::ForCurrentProcess(); - const std::string& lang_arg = - parsed_command_line.GetSwitchValueASCII(switches::kLang); - if (!lang_arg.empty()) - candidates.push_back(lang_arg); - - // Second, try user prefs. + // First, try the preference value. if (!pref_locale.empty()) candidates.push_back(WideToASCII(pref_locale)); @@ -396,15 +389,7 @@ std::string GetApplicationLocale(const std::wstring& pref_locale) { candidates.push_back(system_locale); #elif defined(OS_CHROMEOS) - // We use --lang on chroemos for debugging/troubleshooting purpose. - const CommandLine& parsed_command_line = *CommandLine::ForCurrentProcess(); - const std::string& lang_arg = - parsed_command_line.GetSwitchValueASCII(switches::kLang); - if (!lang_arg.empty()) - candidates.push_back(lang_arg); - - // On ChromeOS, try user prefs. This restores the locale used by the - // previous run of the OS. + // On ChromeOS, use the application locale preference. if (!pref_locale.empty()) candidates.push_back(WideToASCII(pref_locale)); @@ -445,12 +430,11 @@ std::string GetApplicationLocale(const std::wstring& pref_locale) { #else // !defined(OS_MACOSX) - // Use any override (Cocoa for the browser), otherwise use the command line - // argument. + // Use any override (Cocoa for the browser), otherwise use the preference + // passed to the function. std::string app_locale = l10n_util::GetLocaleOverride(); if (app_locale.empty()) { - const CommandLine& parsed_command_line = *CommandLine::ForCurrentProcess(); - app_locale = parsed_command_line.GetSwitchValueASCII(switches::kLang); + app_locale = WideToASCII(pref_locale); } // The above should handle all of the cases Chrome normally hits, but for some diff --git a/chrome/app/chrome_dll_main.cc b/chrome/app/chrome_dll_main.cc index 9e3feb8..03dbac6 100644..100755 --- a/chrome/app/chrome_dll_main.cc +++ b/chrome/app/chrome_dll_main.cc @@ -718,7 +718,14 @@ int ChromeMain(int argc, char** argv) { // browser process as a command line flag. DCHECK(parsed_command_line.HasSwitch(switches::kLang) || process_type == switches::kZygoteProcess); - ResourceBundle::InitSharedInstance(std::wstring()); + + // TODO(markusheintz): The command line flag --lang is actually processed + // by the CommandLinePrefStore, and made available through the PrefService + // via the preference prefs::kApplicationLocale. The browser process uses + // the --lang flag to passe the value of the PrefService in here. Maybe this + // value could be passed in a different way. + ResourceBundle::InitSharedInstance( + parsed_command_line.GetSwitchValue(switches::kLang)); #if defined(OS_MACOSX) // Update the process name (need resources to get the strings, so diff --git a/chrome/app/policy/windows/adm/en-US/chrome.adm b/chrome/app/policy/windows/adm/en-US/chrome.adm index 382c70d..38105f32 100644..100755 --- a/chrome/app/policy/windows/adm/en-US/chrome.adm +++ b/chrome/app/policy/windows/adm/en-US/chrome.adm @@ -33,6 +33,18 @@ CLASS MACHINE END PART END POLICY + POLICY !!ApplicationLocale + #if version >= 4 + SUPPORTED !!SUPPORTED_WINXPSP2 + #endif + EXPLAIN !!ApplicationLocale_Explain + VALUENAME "ApplicationLocale" + + PART !!ApplicationLocaleValue EDITTEXT + VALUENAME "ApplicationLocaleValue" + END PART + END POLICY + POLICY !!AlternateErrorPagesEnabled #if version >= 4 SUPPORTED !!SUPPORTED_WINXPSP2 @@ -153,6 +165,12 @@ CLASS MACHINE SUPPORTED_WINXPSP2="At least Microsoft Windows XP SP2" google="Google" googlechrome="Google Chrome" +ApplicationLocale="Configures the Application Locale" +ApplicationLocale_Explain="Configures the locale to be used by Chrome. If the ApplicationLocale policy is configured, \ +Chrome will use the configured locale. If the configured locale is not supported \ +Chrome will fall back to en-US. If the policy is not configured, Chrome will either use the preference locale (if configured), \ +the system locale or the fallback locale en-US." +ApplicationLocaleValue="Application locale" HomePage="Configure default home page" HomePage_Explain="Configures the default home page and prevents users from changing homepage settings.\n\n\ The homepage can either be set to a URL you specify or set to the New Tab Page.\n\n\ diff --git a/chrome/app/policy/windows/admx/chrome.admx b/chrome/app/policy/windows/admx/chrome.admx index d4de32d..a68ae18 100644 --- a/chrome/app/policy/windows/admx/chrome.admx +++ b/chrome/app/policy/windows/admx/chrome.admx @@ -1,150 +1,157 @@ -<?xml version="1.0" encoding="utf-8"?> -<policyDefinitions revision="1.0" schemaVersion="1.0"> - <policyNamespaces> - <target prefix="fullarmor" namespace="FullArmor.3cca6b27-3c82-4689-8f0b-4ab08f8341da" /> - <using prefix="windows" namespace="Microsoft.Policies.Windows" /> - </policyNamespaces> - <supersededAdm fileName="C:\Development\src\chrome\app\policy\windows\adm\en-US\chrome.adm" /> - <resources minRequiredRevision="1.0" /> - <supportedOn> - <definitions> - <definition name="SUPPORTED_WINXPSP2" displayName="$(string.SUPPORTED_WINXPSP2)" /> - <definition name="SUPPORTED_NotSpecified" displayName="$(string.ADMXMigrator_NoSupportedOn)" /> - </definitions> - </supportedOn> - <categories> - <category name="google" displayName="$(string.google)" /> - <category name="googlechrome" displayName="$(string.googlechrome)"> - <parentCategory ref="google" /> - </category> - </categories> - <policies> - <policy name="HomePage" class="Machine" displayName="$(string.HomePage)" explainText="$(string.HomePage_Explain)" presentation="$(presentation.HomePage)" key="Software\Policies\Google\Chrome" valueName="Homepage"> - <parentCategory ref="googlechrome" /> - <supportedOn ref="SUPPORTED_WINXPSP2" /> - <elements> - <enum id="HomepageMode" valueName="HomepageIsNewTabPage"> - <item displayName="$(string.HomepageIsLocationURL)"> - <value> - <decimal value="0" /> - </value> - </item> - <item displayName="$(string.HomepageIsNewTabPage)"> - <value> - <decimal value="1" /> - </value> - </item> - </enum> - <text id="HomepageLocation" valueName="HomepageLocation" /> - </elements> - </policy> - <policy name="AlternateErrorPagesEnabled" class="Machine" displayName="$(string.AlternateErrorPagesEnabled)" explainText="$(string.AlternateErrorPagesEnabled_Explain)" presentation="$(presentation.AlternateErrorPagesEnabled)" key="Software\Policies\Google\Chrome" valueName="AlternateErrorPagesEnabled"> - <parentCategory ref="googlechrome" /> - <supportedOn ref="SUPPORTED_WINXPSP2" /> - <enabledValue> - <decimal value="1" /> - </enabledValue> - <disabledValue> - <decimal value="0" /> - </disabledValue> - </policy> - <policy name="SearchSuggestEnabled" class="Machine" displayName="$(string.SearchSuggestEnabled)" explainText="$(string.SearchSuggestEnabled_Explain)" presentation="$(presentation.SearchSuggestEnabled)" key="Software\Policies\Google\Chrome" valueName="SearchSuggestEnabled"> - <parentCategory ref="googlechrome" /> - <supportedOn ref="SUPPORTED_WINXPSP2" /> - <enabledValue> - <decimal value="1" /> - </enabledValue> - <disabledValue> - <decimal value="0" /> - </disabledValue> - </policy> - <policy name="DnsPrefetchingEnabled" class="Machine" displayName="$(string.DnsPrefetchingEnabled)" explainText="$(string.DnsPrefetchingEnabled_Explain)" presentation="$(presentation.DnsPrefetchingEnabled)" key="Software\Policies\Google\Chrome" valueName="DnsPrefetchingEnabled"> - <parentCategory ref="googlechrome" /> - <supportedOn ref="SUPPORTED_WINXPSP2" /> - <enabledValue> - <decimal value="1" /> - </enabledValue> - <disabledValue> - <decimal value="0" /> - </disabledValue> - </policy> - <policy name="SafeBrowsingEnabled" class="Machine" displayName="$(string.SafeBrowsingEnabled)" explainText="$(string.SafeBrowsingEnabled_Explain)" presentation="$(presentation.SafeBrowsingEnabled)" key="Software\Policies\Google\Chrome" valueName="SafeBrowsingEnabled"> - <parentCategory ref="googlechrome" /> - <supportedOn ref="SUPPORTED_WINXPSP2" /> - <enabledValue> - <decimal value="1" /> - </enabledValue> - <disabledValue> - <decimal value="0" /> - </disabledValue> - </policy> - <policy name="MetricsReportingEnabled" class="Machine" displayName="$(string.MetricsReportingEnabled)" explainText="$(string.MetricsReportingEnabled_Explain)" presentation="$(presentation.MetricsReportingEnabled)" key="Software\Policies\Google\Chrome" valueName="MetricsReportingEnabled"> - <parentCategory ref="googlechrome" /> - <supportedOn ref="SUPPORTED_WINXPSP2" /> - <enabledValue> - <decimal value="1" /> - </enabledValue> - <disabledValue> - <decimal value="0" /> - </disabledValue> - </policy> - <policy name="PasswordManagerEnabled" class="Machine" displayName="$(string.PasswordManagerEnabled)" explainText="$(string.PasswordManagerEnabled_Explain)" presentation="$(presentation.PasswordManagerEnabled)" key="Software\Policies\Google\Chrome" valueName="PasswordManagerEnabled"> - <parentCategory ref="googlechrome" /> - <supportedOn ref="SUPPORTED_WINXPSP2" /> - <enabledValue> - <decimal value="1" /> - </enabledValue> - <disabledValue> - <decimal value="0" /> - </disabledValue> - </policy> - <policy name="DisabledPlugins" class="Machine" displayName="$(string.DisabledPlugins)" explainText="$(string.DisabledPlugins_Explain)" presentation="$(presentation.DisabledPlugins)" key="Software\Policies\Google\Chrome" valueName="DisabledPlugins"> - <parentCategory ref="googlechrome" /> - <supportedOn ref="SUPPORTED_WINXPSP2" /> - <enabledValue> - <decimal value="1" /> - </enabledValue> - <disabledValue> - <decimal value="0" /> - </disabledValue> - <elements> - <text id="DisabledPluginsList" valueName="DisabledPluginsList" /> - </elements> - </policy> - <policy name="Sync" class="Machine" displayName="$(string.Sync)" explainText="$(string.Sync_Explain)" presentation="$(presentation.Sync)" key="Software\Policies\Google\Chrome" valueName="SyncDisabled"> - <parentCategory ref="googlechrome" /> - <supportedOn ref="SUPPORTED_WINXPSP2" /> - </policy> - <policy name="Proxy" class="Machine" displayName="$(string.Proxy)" explainText="$(string.Proxy_Explain)" presentation="$(presentation.Proxy)" key="Software\Policies\Google\Chrome" valueName="Proxy"> - <parentCategory ref="googlechrome" /> - <supportedOn ref="SUPPORTED_WINXPSP2" /> - <elements> - <enum id="ProxyServerMode" valueName="ProxyServerMode"> - <item displayName="$(string.ProxyServerDisabled)"> - <value> - <decimal value="0" /> - </value> - </item> - <item displayName="$(string.ProxyServerAutoDetect)"> - <value> - <decimal value="1" /> - </value> - </item> - <item displayName="$(string.ProxyServerManual)"> - <value> - <decimal value="2" /> - </value> - </item> - <item displayName="$(string.ProxyServerUseSystem)"> - <value> - <decimal value="3" /> - </value> - </item> - </enum> - <text id="ProxyServer" valueName="ProxyServer" /> - <text id="ProxyPacUrl" valueName="ProxyPacUrl" /> - <text id="ProxyBypassList" valueName="ProxyBypassList" /> - </elements> - </policy> - </policies> -</policyDefinitions> +<?xml version="1.0" encoding="utf-8"?>
+<policyDefinitions revision="1.0" schemaVersion="1.0">
+ <policyNamespaces>
+ <target prefix="fullarmor" namespace="FullArmor.1a993c1c-0aa8-4a4b-973b-5422fac5d26a" />
+ <using prefix="windows" namespace="Microsoft.Policies.Windows" />
+ </policyNamespaces>
+ <supersededAdm fileName="D:\src\chromium\src\chrome\app\policy\windows\adm\en-US\chrome.adm" />
+ <resources minRequiredRevision="1.0" />
+ <supportedOn>
+ <definitions>
+ <definition name="SUPPORTED_WINXPSP2" displayName="$(string.SUPPORTED_WINXPSP2)" />
+ <definition name="SUPPORTED_NotSpecified" displayName="$(string.ADMXMigrator_NoSupportedOn)" />
+ </definitions>
+ </supportedOn>
+ <categories>
+ <category name="google" displayName="$(string.google)" />
+ <category name="googlechrome" displayName="$(string.googlechrome)">
+ <parentCategory ref="google" />
+ </category>
+ </categories>
+ <policies>
+ <policy name="HomePage" class="Machine" displayName="$(string.HomePage)" explainText="$(string.HomePage_Explain)" presentation="$(presentation.HomePage)" key="Software\Policies\Google\Chrome" valueName="Homepage">
+ <parentCategory ref="googlechrome" />
+ <supportedOn ref="SUPPORTED_WINXPSP2" />
+ <elements>
+ <enum id="HomepageMode" valueName="HomepageIsNewTabPage">
+ <item displayName="$(string.HomepageIsLocationURL)">
+ <value>
+ <decimal value="0" />
+ </value>
+ </item>
+ <item displayName="$(string.HomepageIsNewTabPage)">
+ <value>
+ <decimal value="1" />
+ </value>
+ </item>
+ </enum>
+ <text id="HomepageLocation" valueName="HomepageLocation" />
+ </elements>
+ </policy>
+ <policy name="ApplicationLocale" class="Machine" displayName="$(string.ApplicationLocale)" explainText="$(string.ApplicationLocale_Explain)" presentation="$(presentation.ApplicationLocale)" key="Software\Policies\Google\Chrome" valueName="ApplicationLocale">
+ <parentCategory ref="googlechrome" />
+ <supportedOn ref="SUPPORTED_WINXPSP2" />
+ <elements>
+ <text id="ApplicationLocaleValue" valueName="ApplicationLocaleValue" />
+ </elements>
+ </policy>
+ <policy name="AlternateErrorPagesEnabled" class="Machine" displayName="$(string.AlternateErrorPagesEnabled)" explainText="$(string.AlternateErrorPagesEnabled_Explain)" presentation="$(presentation.AlternateErrorPagesEnabled)" key="Software\Policies\Google\Chrome" valueName="AlternateErrorPagesEnabled">
+ <parentCategory ref="googlechrome" />
+ <supportedOn ref="SUPPORTED_WINXPSP2" />
+ <enabledValue>
+ <decimal value="1" />
+ </enabledValue>
+ <disabledValue>
+ <decimal value="0" />
+ </disabledValue>
+ </policy>
+ <policy name="SearchSuggestEnabled" class="Machine" displayName="$(string.SearchSuggestEnabled)" explainText="$(string.SearchSuggestEnabled_Explain)" presentation="$(presentation.SearchSuggestEnabled)" key="Software\Policies\Google\Chrome" valueName="SearchSuggestEnabled">
+ <parentCategory ref="googlechrome" />
+ <supportedOn ref="SUPPORTED_WINXPSP2" />
+ <enabledValue>
+ <decimal value="1" />
+ </enabledValue>
+ <disabledValue>
+ <decimal value="0" />
+ </disabledValue>
+ </policy>
+ <policy name="DnsPrefetchingEnabled" class="Machine" displayName="$(string.DnsPrefetchingEnabled)" explainText="$(string.DnsPrefetchingEnabled_Explain)" presentation="$(presentation.DnsPrefetchingEnabled)" key="Software\Policies\Google\Chrome" valueName="DnsPrefetchingEnabled">
+ <parentCategory ref="googlechrome" />
+ <supportedOn ref="SUPPORTED_WINXPSP2" />
+ <enabledValue>
+ <decimal value="1" />
+ </enabledValue>
+ <disabledValue>
+ <decimal value="0" />
+ </disabledValue>
+ </policy>
+ <policy name="SafeBrowsingEnabled" class="Machine" displayName="$(string.SafeBrowsingEnabled)" explainText="$(string.SafeBrowsingEnabled_Explain)" presentation="$(presentation.SafeBrowsingEnabled)" key="Software\Policies\Google\Chrome" valueName="SafeBrowsingEnabled">
+ <parentCategory ref="googlechrome" />
+ <supportedOn ref="SUPPORTED_WINXPSP2" />
+ <enabledValue>
+ <decimal value="1" />
+ </enabledValue>
+ <disabledValue>
+ <decimal value="0" />
+ </disabledValue>
+ </policy>
+ <policy name="MetricsReportingEnabled" class="Machine" displayName="$(string.MetricsReportingEnabled)" explainText="$(string.MetricsReportingEnabled_Explain)" presentation="$(presentation.MetricsReportingEnabled)" key="Software\Policies\Google\Chrome" valueName="MetricsReportingEnabled">
+ <parentCategory ref="googlechrome" />
+ <supportedOn ref="SUPPORTED_WINXPSP2" />
+ <enabledValue>
+ <decimal value="1" />
+ </enabledValue>
+ <disabledValue>
+ <decimal value="0" />
+ </disabledValue>
+ </policy>
+ <policy name="PasswordManagerEnabled" class="Machine" displayName="$(string.PasswordManagerEnabled)" explainText="$(string.PasswordManagerEnabled_Explain)" presentation="$(presentation.PasswordManagerEnabled)" key="Software\Policies\Google\Chrome" valueName="PasswordManagerEnabled">
+ <parentCategory ref="googlechrome" />
+ <supportedOn ref="SUPPORTED_WINXPSP2" />
+ <enabledValue>
+ <decimal value="1" />
+ </enabledValue>
+ <disabledValue>
+ <decimal value="0" />
+ </disabledValue>
+ </policy>
+ <policy name="DisabledPlugins" class="Machine" displayName="$(string.DisabledPlugins)" explainText="$(string.DisabledPlugins_Explain)" presentation="$(presentation.DisabledPlugins)" key="Software\Policies\Google\Chrome" valueName="DisabledPlugins">
+ <parentCategory ref="googlechrome" />
+ <supportedOn ref="SUPPORTED_WINXPSP2" />
+ <enabledValue>
+ <decimal value="1" />
+ </enabledValue>
+ <disabledValue>
+ <decimal value="0" />
+ </disabledValue>
+ <elements>
+ <text id="DisabledPluginsList" valueName="DisabledPluginsList" />
+ </elements>
+ </policy>
+ <policy name="Sync" class="Machine" displayName="$(string.Sync)" explainText="$(string.Sync_Explain)" presentation="$(presentation.Sync)" key="Software\Policies\Google\Chrome" valueName="SyncDisabled">
+ <parentCategory ref="googlechrome" />
+ <supportedOn ref="SUPPORTED_WINXPSP2" />
+ </policy>
+ <policy name="Proxy" class="Machine" displayName="$(string.Proxy)" explainText="$(string.Proxy_Explain)" presentation="$(presentation.Proxy)" key="Software\Policies\Google\Chrome" valueName="Proxy">
+ <parentCategory ref="googlechrome" />
+ <supportedOn ref="SUPPORTED_WINXPSP2" />
+ <elements>
+ <enum id="ProxyServerMode" valueName="ProxyServerMode">
+ <item displayName="$(string.ProxyServerDisabled)">
+ <value>
+ <decimal value="0" />
+ </value>
+ </item>
+ <item displayName="$(string.ProxyServerAutoDetect)">
+ <value>
+ <decimal value="1" />
+ </value>
+ </item>
+ <item displayName="$(string.ProxyServerManual)">
+ <value>
+ <decimal value="2" />
+ </value>
+ </item>
+ <item displayName="$(string.ProxyServerUseSystem)">
+ <value>
+ <decimal value="3" />
+ </value>
+ </item>
+ </enum>
+ <text id="ProxyServer" valueName="ProxyServer" />
+ <text id="ProxyPacUrl" valueName="ProxyPacUrl" />
+ <text id="ProxyBypassList" valueName="ProxyBypassList" />
+ </elements>
+ </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 5230588..bebd8c7 100644 --- a/chrome/app/policy/windows/admx/en-US/chrome.adml +++ b/chrome/app/policy/windows/admx/en-US/chrome.adml @@ -1,130 +1,137 @@ -<?xml version="1.0" encoding="utf-8"?> -<policyDefinitionResources revision="1.0" schemaVersion="1.0"> - <displayName></displayName> - <description></description> - <resources> - <stringTable> - <string id="SUPPORTED_WINXPSP2">At least Microsoft Windows XP SP2</string> - <string id="google">Google</string> - <string id="googlechrome">Google Chrome</string> - <string id="HomePage">Configure default home page</string> - <string id="HomePage_Explain">Configures the default home page and prevents users from changing homepage settings. - -The homepage can either be set to a URL you specify or set to the New Tab Page. - -If you specify the New Tab Page is specified as the homepage, the homepage URL location is ignored. - -If you enable this setting, users cannot change their homepage settings in Google Chrome.</string> - <string id="HomepageMode">Homepage type:</string> - <string id="HomepageIsLocationURL">Always use homepage URL as homepage</string> - <string id="HomepageIsNewTabPage">Always use New Tab Page as homepage</string> - <string id="HomepageLocation">Homepage URL:</string> - <string id="Proxy">Configure proxy server</string> - <string id="Proxy_Explain">Allows you to specify the proxy server used by Google Chrome and prevents users from changing proxy settings. - -If you choose to never use a proxy server and always connect directly, all other options will be ignored. - -If you choose to auto detect the proxy server, all other options will be ignored. - -For detailed examples, visit: http://www.chromium.org/developers/design-documents/network-settings#TOC-Command-line-options-for-proxy-sett - -If you enable this setting, Google Chrome will ignore all proxy-related options specified from the command line.</string> - <string id="ProxyServer">Address or URL of proxy server:</string> - <string id="ProxyServerMode">Choose how to specify proxy server settings:</string> - <string id="ProxyServerDisabled">Never use a proxy</string> - <string id="ProxyServerAutoDetect">Auto detect proxy settings</string> - <string id="ProxyServerManual">Manually specify proxy settings</string> - <string id="ProxyServerUseSystem">Use system proxy settings</string> - <string id="ProxyBypassList">Comma-separated list of bypass rules:</string> - <string id="ProxyPacUrl">URL to a proxy .pac file:</string> - <string id="AlternateErrorPagesEnabled">Enable alternate error pages</string> - <string id="AlternateErrorPagesEnabled_Explain">Enables the use of alternate error pages that are built into Google Chrome (such as 'page not found') and prevents users from changing this setting. - -If you enable this setting, alternate error pages will be used. - -If you disable this setting, alternate error pages will never be used. - -If you enable or disable this setting, users cannot change or override this setting in Google Chrome.</string> - <string id="SearchSuggestEnabled">Enable search suggestions</string> - <string id="SearchSuggestEnabled_Explain">Enables search suggestions in the Omnibox and prevents users from changing this setting. - -If you enable this setting, search suggestions will be used. - -If you disable this setting, search suggestions will never be used. - -If you enable or disable this setting, users cannot change or override this setting in Google Chrome.</string> - <string id="DnsPrefetchingEnabled">Enable search suggestions</string> - <string id="DnsPrefetchingEnabled_Explain">Enables DNS prefecthing and prevents users from changing this setting. - -If you enable or disable this setting, users cannot change or override this setting in Google Chrome.</string> - <string id="SafeBrowsingEnabled">Enable Safe Browsing</string> - <string id="SafeBrowsingEnabled_Explain">Enables and disables whether Google Chrome's Safe Browsing feature and prevents users from changing this setting. - -If you enable this setting, Safe Browsing will always be active. - -If you disable this setting, Safe Browsing will never be active. - -If you enable or disable this setting, users cannot change or override this setting in Google Chrome.</string> - <string id="MetricsReportingEnabled">Enable reporting of usage and crash-related data</string> - <string id="MetricsReportingEnabled_Explain">Enables the anonymous reporting of usage and crash-related data to Google and prevents users from changing this setting. - -If you enable this setting, anonymous reporting of usage and crash-related data will be sent to Google. - -If you disable this setting, anonymous reporting of usage and crash-related data will never be sent to Google. - -If you enable or disable this setting, users cannot change or override this setting in Google Chrome.</string> - <string id="PasswordManagerEnabled">Enable the password manager</string> - <string id="PasswordManagerEnabled_Explain">Enables saving passwords and using saved passwords. - -If you enable this setting, users can have Google Chrome memorize passwords and provide them when the form is next filled. - -If you disable this setting, users will not be able to save passwords or use already saved passwords. - -If you enable or disable this setting, users cannot change or override this setting in Google Chrome. - </string> - <string id="DisabledPlugins">Specify a list of plugins that are disabled</string> - <string id="DisabledPlugins_Explain">Specifies a list of plugins that are disabled and prevents users from changing this setting. - -value is a comma-separated list of the names of plugins to be disabled.</string> - <string id="DisabledPluginsList">Comma-separated list of disabled plugins:</string> - <string id="Sync">Disallow synchronization of data with Google</string> - <string id="Sync_Explain">Disallows data synchronization using Google-hosted sync 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="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> - <presentationTable> - <presentation id="HomePage"> - <dropdownList refId="HomepageMode">Homepage type:</dropdownList> - <textBox refId="HomepageLocation"> - <label>Homepage URL:</label> - </textBox> - </presentation> - <presentation id="AlternateErrorPagesEnabled" /> - <presentation id="SearchSuggestEnabled" /> - <presentation id="DnsPrefetchingEnabled" /> - <presentation id="SafeBrowsingEnabled" /> - <presentation id="MetricsReportingEnabled" /> - <presentation id="PasswordManagerEnabled" /> - <presentation id="DisabledPlugins"> - <textBox refId="DisabledPluginsList"> - <label>Comma-separated list of disabled plugins:</label> - </textBox> - </presentation> - <presentation id="Sync" /> - <presentation id="Proxy"> - <dropdownList refId="ProxyServerMode">Choose how to specify proxy server settings:</dropdownList> - <textBox refId="ProxyServer"> - <label>Address or URL of proxy server:</label> - </textBox> - <textBox refId="ProxyPacUrl"> - <label>URL to a proxy .pac file:</label> - </textBox> - <textBox refId="ProxyBypassList"> - <label>Comma-separated list of bypass rules:</label> - </textBox> - </presentation> - </presentationTable> - </resources> -</policyDefinitionResources> +<?xml version="1.0" encoding="utf-8"?>
+<policyDefinitionResources revision="1.0" schemaVersion="1.0">
+ <displayName></displayName>
+ <description></description>
+ <resources>
+ <stringTable>
+ <string id="SUPPORTED_WINXPSP2">At least Microsoft Windows XP SP2</string>
+ <string id="google">Google</string>
+ <string id="googlechrome">Google Chrome</string>
+ <string id="ApplicationLocale">Configures the Application Locale</string>
+ <string id="ApplicationLocale_Explain">Configures the locale to be used by Chrome. If the ApplicationLocale policy is configured, Chrome will use the configured locale. If the configured locale is not supported Chrome will fall back to en-US. If the policy is not configured, Chrome will either use the preference locale (if configured), the system locale or the fallback locale en-US.</string>
+ <string id="ApplicationLocaleValue">Application locale</string>
+ <string id="HomePage">Configure default home page</string>
+ <string id="HomePage_Explain">Configures the default home page and prevents users from changing homepage settings.
+
+The homepage can either be set to a URL you specify or set to the New Tab Page.
+
+If you specify the New Tab Page is specified as the homepage, the homepage URL location is ignored.
+
+If you enable this setting, users cannot change their homepage settings in Google Chrome.</string>
+ <string id="HomepageMode">Homepage type:</string>
+ <string id="HomepageIsLocationURL">Always use homepage URL as homepage</string>
+ <string id="HomepageIsNewTabPage">Always use New Tab Page as homepage</string>
+ <string id="HomepageLocation">Homepage URL:</string>
+ <string id="Proxy">Configure proxy server</string>
+ <string id="Proxy_Explain">Allows you to specify the proxy server used by Google Chrome and prevents users from changing proxy settings.
+
+If you choose to never use a proxy server and always connect directly, all other options will be ignored.
+
+If you choose to auto detect the proxy server, all other options will be ignored.
+
+For detailed examples, visit: http://www.chromium.org/developers/design-documents/network-settings#TOC-Command-line-options-for-proxy-sett
+
+If you enable this setting, Google Chrome will ignore all proxy-related options specified from the command line.</string>
+ <string id="ProxyServer">Address or URL of proxy server:</string>
+ <string id="ProxyServerMode">Choose how to specify proxy server settings:</string>
+ <string id="ProxyServerDisabled">Never use a proxy</string>
+ <string id="ProxyServerAutoDetect">Auto detect proxy settings</string>
+ <string id="ProxyServerManual">Manually specify proxy settings</string>
+ <string id="ProxyServerUseSystem">Use system proxy settings</string>
+ <string id="ProxyBypassList">Comma-separated list of bypass rules:</string>
+ <string id="ProxyPacUrl">URL to a proxy .pac file:</string>
+ <string id="AlternateErrorPagesEnabled">Enable alternate error pages</string>
+ <string id="AlternateErrorPagesEnabled_Explain">Enables the use of alternate error pages that are built into Google Chrome (such as 'page not found') and prevents users from changing this setting.
+
+If you enable this setting, alternate error pages will be used.
+
+If you disable this setting, alternate error pages will never be used.
+
+If you enable or disable this setting, users cannot change or override this setting in Google Chrome.</string>
+ <string id="SearchSuggestEnabled">Enable search suggestions</string>
+ <string id="SearchSuggestEnabled_Explain">Enables search suggestions in the Omnibox and prevents users from changing this setting.
+
+If you enable this setting, search suggestions will be used.
+
+If you disable this setting, search suggestions will never be used.
+
+If you enable or disable this setting, users cannot change or override this setting in Google Chrome.</string>
+ <string id="DnsPrefetchingEnabled">Enable search suggestions</string>
+ <string id="DnsPrefetchingEnabled_Explain">Enables DNS prefecthing and prevents users from changing this setting.
+
+If you enable or disable this setting, users cannot change or override this setting in Google Chrome.</string>
+ <string id="SafeBrowsingEnabled">Enable Safe Browsing</string>
+ <string id="SafeBrowsingEnabled_Explain">Enables and disables whether Google Chrome's Safe Browsing feature and prevents users from changing this setting.
+
+If you enable this setting, Safe Browsing will always be active.
+
+If you disable this setting, Safe Browsing will never be active.
+
+If you enable or disable this setting, users cannot change or override this setting in Google Chrome.</string>
+ <string id="MetricsReportingEnabled">Enable reporting of usage and crash-related data</string>
+ <string id="MetricsReportingEnabled_Explain">Enables the anonymous reporting of usage and crash-related data to Google and prevents users from changing this setting.
+
+If you enable this setting, anonymous reporting of usage and crash-related data will be sent to Google.
+
+If you disable this setting, anonymous reporting of usage and crash-related data will never be sent to Google.
+
+If you enable or disable this setting, users cannot change or override this setting in Google Chrome.</string>
+ <string id="PasswordManagerEnabled">Enable the password manager</string>
+ <string id="PasswordManagerEnabled_Explain">Enables saving passwords and using saved passwords.
+
+If you enable this setting, users can have Google Chrome memorize passwords and provide them when the form is next filled.
+
+If you disable this setting, users will not be able to save passwords or use already saved passwords.
+
+If you enable or disable this setting, users cannot change or override this setting in Google Chrome.</string>
+ <string id="DisabledPlugins">Specify a list of plugins that are disabled</string>
+ <string id="DisabledPlugins_Explain">Specifies a list of plugins that are disabled and prevents users from changing this setting.
+
+value is a comma-separated list of the names of plugins to be disabled.</string>
+ <string id="DisabledPluginsList">Comma-separated list of disabled plugins:</string>
+ <string id="Sync">Disallow synchronization of data with Google</string>
+ <string id="Sync_Explain">Disallows data synchronization using Google-hosted sync 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="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>
+ <presentationTable>
+ <presentation id="HomePage">
+ <dropdownList refId="HomepageMode">Homepage type:</dropdownList>
+ <textBox refId="HomepageLocation">
+ <label>Homepage URL:</label>
+ </textBox>
+ </presentation>
+ <presentation id="ApplicationLocale">
+ <textBox refId="ApplicationLocaleValue">
+ <label>Application locale</label>
+ </textBox>
+ </presentation>
+ <presentation id="AlternateErrorPagesEnabled" />
+ <presentation id="SearchSuggestEnabled" />
+ <presentation id="DnsPrefetchingEnabled" />
+ <presentation id="SafeBrowsingEnabled" />
+ <presentation id="MetricsReportingEnabled" />
+ <presentation id="PasswordManagerEnabled" />
+ <presentation id="DisabledPlugins">
+ <textBox refId="DisabledPluginsList">
+ <label>Comma-separated list of disabled plugins:</label>
+ </textBox>
+ </presentation>
+ <presentation id="Sync" />
+ <presentation id="Proxy">
+ <dropdownList refId="ProxyServerMode">Choose how to specify proxy server settings:</dropdownList>
+ <textBox refId="ProxyServer">
+ <label>Address or URL of proxy server:</label>
+ </textBox>
+ <textBox refId="ProxyPacUrl">
+ <label>URL to a proxy .pac file:</label>
+ </textBox>
+ <textBox refId="ProxyBypassList">
+ <label>Comma-separated list of bypass rules:</label>
+ </textBox>
+ </presentation>
+ </presentationTable>
+ </resources>
+</policyDefinitionResources>
\ No newline at end of file diff --git a/chrome/browser/browser_main.cc b/chrome/browser/browser_main.cc index af6098a..265fec1 100644 --- a/chrome/browser/browser_main.cc +++ b/chrome/browser/browser_main.cc @@ -812,6 +812,8 @@ int BrowserMain(const MainFunctionParams& parameters) { #if defined(OS_MACOSX) g_browser_process->SetApplicationLocale(l10n_util::GetLocaleOverride()); #else + // On a POSIX OS other than ChromeOS, the parameter that is passed to the + // method InitSharedInstance is ignored. std::string app_locale = ResourceBundle::InitSharedInstance( ASCIIToWide(local_state->GetString(prefs::kApplicationLocale))); g_browser_process->SetApplicationLocale(app_locale); diff --git a/chrome/browser/browser_main_mac.mm b/chrome/browser/browser_main_mac.mm index eb7d130..f0f0861 100644..100755 --- a/chrome/browser/browser_main_mac.mm +++ b/chrome/browser/browser_main_mac.mm @@ -46,7 +46,10 @@ void WillInitializeMainMessageLoop(const MainFunctionParams& parameters) { // Before we load the nib, we need to start up the resource bundle so we // have the strings avaiable for localization. - ResourceBundle::InitSharedInstance(std::wstring()); + std::wstring pref_locale; + // TODO(markusheintz): Read preference pref::kApplicationLocale in order to + // enforce the application locale. + ResourceBundle::InitSharedInstance(pref_locale); FilePath resources_pack_path; PathService::Get(chrome::FILE_RESOURCES_PACK, &resources_pack_path); diff --git a/chrome/browser/chromeos/input_method/candidate_window.cc b/chrome/browser/chromeos/input_method/candidate_window.cc index 17c9676..9b9ee5b 100644..100755 --- a/chrome/browser/chromeos/input_method/candidate_window.cc +++ b/chrome/browser/chromeos/input_method/candidate_window.cc @@ -1045,6 +1045,13 @@ int main(int argc, char** argv) { base::EnableTerminationOnHeapCorruption(); app::RegisterPathProvider(); CommandLine::Init(argc, argv); + // TODO(markusheintz): The command line switch --Lang is now processed + // by the CommandLinePrefStore and mapped to the preference + // prefs::kApplicationLocale. This preferences can be read through the + // PrefService. l10n_util::GetApplicationLocale() which is called by the + // ResourceBundle code now ignores the --Lang flag. + // In order to support the --Lang flag here the preference + // prefs::kApplicationLocale must be read and passed instead of L"en-US". ResourceBundle::InitSharedInstance(L"en-US"); // Write logs to a file for debugging, if --logtofile=FILE_NAME is given. diff --git a/chrome/browser/chromeos/login/language_switch_menu.cc b/chrome/browser/chromeos/login/language_switch_menu.cc index ae64358..d93e8fe 100644..100755 --- a/chrome/browser/chromeos/login/language_switch_menu.cc +++ b/chrome/browser/chromeos/login/language_switch_menu.cc @@ -88,19 +88,26 @@ void LanguageSwitchMenu::SwitchLanguage(const std::string& locale) { // Save new locale. DCHECK(g_browser_process); PrefService* prefs = g_browser_process->local_state(); - prefs->SetString(prefs::kApplicationLocale, locale); - prefs->SavePersistentPrefs(); - - // Switch the locale. - ResourceBundle::ReloadSharedInstance(UTF8ToWide(locale)); - - // Enable the keyboard layouts that are necessary for the new locale. - chromeos::input_method::EnableInputMethods( - locale, chromeos::input_method::kKeyboardLayoutsOnly, - kHardwareKeyboardLayout); - - // The following line does not seem to affect locale anyhow. Maybe in future.. - g_browser_process->SetApplicationLocale(locale); + // TODO(markusheintz): If the preference is managed and can not be changed by + // the user, changing the language should be disabled in the UI. + // TODO(markusheintz): Change the if condition to prefs->IsUserModifiable() + // once Mattias landed his pending patch. + if (!prefs->IsManagedPreference(prefs::kApplicationLocale)) { + prefs->SetString(prefs::kApplicationLocale, locale); + prefs->SavePersistentPrefs(); + + // Switch the locale. + ResourceBundle::ReloadSharedInstance(UTF8ToWide(locale)); + + // Enable the keyboard layouts that are necessary for the new locale. + chromeos::input_method::EnableInputMethods( + locale, chromeos::input_method::kKeyboardLayoutsOnly, + kHardwareKeyboardLayout); + + // The following line does not seem to affect locale anyhow. Maybe in + // future.. + g_browser_process->SetApplicationLocale(locale); + } } //////////////////////////////////////////////////////////////////////////////// diff --git a/chrome/browser/configuration_policy_pref_store.cc b/chrome/browser/configuration_policy_pref_store.cc index 705aaf6..dc12e63 100644 --- a/chrome/browser/configuration_policy_pref_store.cc +++ b/chrome/browser/configuration_policy_pref_store.cc @@ -30,6 +30,8 @@ const ConfigurationPolicyPrefStore::PolicyToPreferenceMapEntry prefs::kPasswordManagerEnabled }, { Value::TYPE_BOOLEAN, kPolicyMetricsReportingEnabled, prefs::kMetricsReportingEnabled }, + { Value::TYPE_STRING, kPolicyApplicationLocale,
+ prefs::kApplicationLocale}, }; const ConfigurationPolicyPrefStore::PolicyToPreferenceMapEntry diff --git a/chrome/browser/configuration_policy_provider.cc b/chrome/browser/configuration_policy_provider.cc index 9a800d6..1bcfaff 100644 --- a/chrome/browser/configuration_policy_provider.cc +++ b/chrome/browser/configuration_policy_provider.cc @@ -44,6 +44,8 @@ const InternalPolicyValueMapEntry kPolicyValueMap[] = { Value::TYPE_BOOLEAN, "PasswordManagerEnabled" }, { ConfigurationPolicyStore::kPolicyDisabledPlugins, Value::TYPE_STRING, "DisabledPluginsList" }, + { ConfigurationPolicyStore::kPolicyApplicationLocale,
+ Value::TYPE_STRING, "ApplicationLocaleValue" }, { ConfigurationPolicyStore::kPolicySyncDisabled, Value::TYPE_BOOLEAN, "SyncDisabled" }, }; diff --git a/chrome/browser/configuration_policy_store.h b/chrome/browser/configuration_policy_store.h index 55d7eb85..cbf1bb1 100644 --- a/chrome/browser/configuration_policy_store.h +++ b/chrome/browser/configuration_policy_store.h @@ -28,6 +28,7 @@ class ConfigurationPolicyStore { kPolicyMetricsReportingEnabled, kPolicyPasswordManagerEnabled, kPolicySyncDisabled, + kPolicyApplicationLocale, // A policy for allowing administrators to forcibly disable // specific plugins. This policy is a comma-separated list of diff --git a/chrome/browser/pref_service.cc b/chrome/browser/pref_service.cc index 3a94748..9db99bc 100644 --- a/chrome/browser/pref_service.cc +++ b/chrome/browser/pref_service.cc @@ -407,6 +407,14 @@ const PrefService::Preference* PrefService::FindPreference( return it == prefs_.end() ? NULL : *it; } +bool PrefService::IsManagedPreference(const wchar_t* pref_name) const { + const Preference* pref = FindPreference(pref_name); + if (pref && pref->IsManaged()) { + return true; + } + return false; +} + void PrefService::FireObserversIfChanged(const wchar_t* path, const Value* old_value) { if (PrefIsChanged(path, old_value)) diff --git a/chrome/browser/pref_service.h b/chrome/browser/pref_service.h index 9e31d9b..255214a 100644 --- a/chrome/browser/pref_service.h +++ b/chrome/browser/pref_service.h @@ -108,6 +108,10 @@ class PrefService : public NonThreadSafe { // values while the importer process is running. Returns true on success. bool ReloadPersistentPrefs(); + // Returns true if the preference for the given preference name is available + // and is managed. + bool IsManagedPreference(const wchar_t* pref_name) const; + // Writes the data to disk. The return value only reflects whether // serialization was successful; we don't know whether the data actually made // it on disk (since it's on a different thread). This should only be used if |