diff options
author | glotov@google.com <glotov@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-04-14 17:58:52 +0000 |
---|---|---|
committer | glotov@google.com <glotov@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-04-14 17:58:52 +0000 |
commit | 4549b0c7c309791cec499dc858609a07ae95a207 (patch) | |
tree | a74f5d1ec77227d1c903a6d3952e5c88ba8f7be7 /app/resource_bundle_win.cc | |
parent | 2abf2acb3ab6c5a5a1f25f8a586e4385d5f9a125 (diff) | |
download | chromium_src-4549b0c7c309791cec499dc858609a07ae95a207.zip chromium_src-4549b0c7c309791cec499dc858609a07ae95a207.tar.gz chromium_src-4549b0c7c309791cec499dc858609a07ae95a207.tar.bz2 |
ReloadSharedInstance() added to change the locale on the live system.
BUG=none
TEST=none
Review URL: http://codereview.chromium.org/1648004
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@44498 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'app/resource_bundle_win.cc')
-rw-r--r-- | app/resource_bundle_win.cc | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/app/resource_bundle_win.cc b/app/resource_bundle_win.cc index 72cfb38..6161e71 100644 --- a/app/resource_bundle_win.cc +++ b/app/resource_bundle_win.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. +// Copyright (c) 2010 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -31,19 +31,28 @@ DWORD GetDataDllLoadFlags() { ResourceBundle::~ResourceBundle() { FreeImages(); + UnloadLocaleResources(); + resources_data_ = NULL; +} +void ResourceBundle::UnloadLocaleResources() { if (locale_resources_data_) { BOOL rv = FreeLibrary(locale_resources_data_); DCHECK(rv); + locale_resources_data_ = NULL; } } -std::string ResourceBundle::LoadResources(const std::wstring& pref_locale) { +void ResourceBundle::LoadCommonResources() { // As a convenience, set resources_data_ to the current resource module. + DCHECK(NULL == resources_data_) << "common resources already loaded"; resources_data_ = _AtlBaseModule.GetResourceInstance(); +} +std::string ResourceBundle::LoadLocaleResources( + const std::wstring& pref_locale) { DCHECK(NULL == locale_resources_data_) << "locale dll already loaded"; - std::string app_locale = l10n_util::GetApplicationLocale(pref_locale); + const std::string app_locale = l10n_util::GetApplicationLocale(pref_locale); const FilePath& locale_path = GetLocaleFilePath(app_locale); if (locale_path.value().empty()) { // It's possible that there are no locale dlls found, in which case we just |