Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(293)

Side by Side Diff: remoting/base/resources_linux.cc

Issue 1318773003: Move remoting/base/resources* to remoting/host (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « remoting/base/resources.h ('k') | remoting/base/resources_mac.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #include "remoting/base/resources.h"
6
7 #include <dlfcn.h>
8
9 #include "base/files/file_path.h"
10 #include "base/logging.h"
11 #include "base/path_service.h"
12 #include "ui/base/resource/resource_bundle.h"
13 #include "ui/base/ui_base_paths.h"
14
15 namespace remoting {
16
17 namespace {
18 const char kLocaleResourcesDirName[] = "remoting_locales";
19 } // namespace
20
21 bool LoadResources(const std::string& pref_locale) {
22 if (ui::ResourceBundle::HasSharedInstance()) {
23 ui::ResourceBundle::GetSharedInstance().ReloadLocaleResources(pref_locale);
24 } else {
25 // Retrieve the path to the module containing this function.
26 Dl_info info;
27 CHECK(dladdr(reinterpret_cast<void*>(&LoadResources), &info) != 0);
28
29 // Point DIR_LOCALES to 'remoting_locales'.
30 base::FilePath path = base::FilePath(info.dli_fname).DirName();
31 PathService::Override(ui::DIR_LOCALES,
32 path.AppendASCII(kLocaleResourcesDirName));
33
34 ui::ResourceBundle::InitSharedInstanceWithLocale(
35 pref_locale, NULL, ui::ResourceBundle::DO_NOT_LOAD_COMMON_RESOURCES);
36 }
37
38 return true;
39 }
40
41 void UnloadResources() {
42 ui::ResourceBundle::CleanupSharedInstance();
43 }
44
45 } // namespace remoting
OLDNEW
« no previous file with comments | « remoting/base/resources.h ('k') | remoting/base/resources_mac.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698