1 // Copyright (c) 2012 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.
5 #include "remoting/base/resources.h"
7 #include "base/file_path.h"
8 #include "base/path_service.h"
9 #include "ui/base/resource/resource_bundle.h"
10 #include "ui/base/ui_base_paths.h"
15 const char kLocaleResourcesDirName
[] = "remoting_locales";
16 const char kCommonResourcesFileName
[] = "chrome_remote_desktop.pak";
19 // Loads chromoting resources.
20 bool LoadResources(const std::string
& pref_locale
) {
22 if (!PathService::Get(base::DIR_MODULE
, &path
))
25 PathService::Override(ui::DIR_LOCALES
,
26 path
.AppendASCII(kLocaleResourcesDirName
));
27 ui::ResourceBundle::InitSharedInstanceLocaleOnly(pref_locale
, NULL
);
29 ui::ResourceBundle::GetSharedInstance().AddDataPackFromPath(
30 path
.AppendASCII(kCommonResourcesFileName
), ui::SCALE_FACTOR_100P
);
35 } // namespace remoting