| Index: ui/base/resource/resource_bundle_android.cc
|
| diff --git a/ui/base/resource/resource_bundle_android.cc b/ui/base/resource/resource_bundle_android.cc
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..dbb671d9565652bcf89db0ae3730bd6f4c909c97
|
| --- /dev/null
|
| +++ b/ui/base/resource/resource_bundle_android.cc
|
| @@ -0,0 +1,54 @@
|
| +// Copyright (c) 2011 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.
|
| +
|
| +#include "ui/base/resource/resource_bundle.h"
|
| +
|
| +#include <string>
|
| +
|
| +#include "base/file_path.h"
|
| +#include "base/file_util.h"
|
| +#include "base/logging.h"
|
| +#include "base/path_service.h"
|
| +#include "base/stringprintf.h"
|
| +
|
| +// We use a trick where we bundle the resource files in the apk
|
| +// as fake shared libraries. We should stop doing this as soon as either the
|
| +// resource files come pre-installed on the platform or there is a supported
|
| +// way to include additional files in the APK that get unpacked at install
|
| +// time.
|
| +
|
| +namespace ui {
|
| +
|
| +// static
|
| +FilePath ResourceBundle::GetResourcesFilePath() {
|
| + FilePath data_path;
|
| + PathService::Get(base::DIR_MODULE, &data_path);
|
| + DCHECK(!data_path.empty());
|
| + return data_path.Append("lib_chrome.pak.so");
|
| +}
|
| +
|
| +// static
|
| +FilePath ResourceBundle::GetLocaleFilePath(const std::string& app_locale) {
|
| + FilePath locale_path;
|
| + PathService::Get(base::DIR_MODULE, &locale_path);
|
| + DCHECK(!locale_path.empty());
|
| + const std::string locale_name =
|
| + StringPrintf("lib_%s.pak.so", app_locale.c_str());
|
| + locale_path = locale_path.Append(locale_name);
|
| + if (!file_util::PathExists(locale_path))
|
| + return FilePath();
|
| + return locale_path;
|
| +}
|
| +
|
| +gfx::Image& ResourceBundle::GetNativeImageNamed(int resource_id) {
|
| + return GetImageNamed(resource_id);
|
| +}
|
| +
|
| +// static
|
| +FilePath ResourceBundle::GetLargeIconResourcesFilePath() {
|
| + // Not supported.
|
| + return FilePath();
|
| +}
|
| +
|
| +}
|
|
|