OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "remoting/base/resources.h" | 5 #include "remoting/base/resources.h" |
6 | 6 |
7 #include <dlfcn.h> | 7 #include <dlfcn.h> |
8 | 8 |
9 #include "base/files/file_path.h" | 9 #include "base/files/file_path.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 13 matching lines...) Expand all Loading... |
24 } else { | 24 } else { |
25 // Retrieve the path to the module containing this function. | 25 // Retrieve the path to the module containing this function. |
26 Dl_info info; | 26 Dl_info info; |
27 CHECK(dladdr(reinterpret_cast<void*>(&LoadResources), &info) != 0); | 27 CHECK(dladdr(reinterpret_cast<void*>(&LoadResources), &info) != 0); |
28 | 28 |
29 // Point DIR_LOCALES to 'remoting_locales'. | 29 // Point DIR_LOCALES to 'remoting_locales'. |
30 base::FilePath path = base::FilePath(info.dli_fname).DirName(); | 30 base::FilePath path = base::FilePath(info.dli_fname).DirName(); |
31 PathService::Override(ui::DIR_LOCALES, | 31 PathService::Override(ui::DIR_LOCALES, |
32 path.AppendASCII(kLocaleResourcesDirName)); | 32 path.AppendASCII(kLocaleResourcesDirName)); |
33 | 33 |
34 ui::ResourceBundle::InitSharedInstanceLocaleOnly(pref_locale, NULL); | 34 ui::ResourceBundle::InitSharedInstanceWithLocale( |
| 35 pref_locale, NULL, ui::ResourceBundle::DO_NOT_LOAD_COMMON_RESOURCES); |
35 } | 36 } |
36 | 37 |
37 return true; | 38 return true; |
38 } | 39 } |
39 | 40 |
40 void UnloadResources() { | 41 void UnloadResources() { |
41 ui::ResourceBundle::CleanupSharedInstance(); | 42 ui::ResourceBundle::CleanupSharedInstance(); |
42 } | 43 } |
43 | 44 |
44 } // namespace remoting | 45 } // namespace remoting |
OLD | NEW |