This source file includes following definitions.
- GetResourcesPakFilePath
- LoadCommonResources
- GetNativeImageNamed
#include "ui/base/resource/resource_bundle.h"
#include "base/command_line.h"
#include "base/logging.h"
#include "base/path_service.h"
#include "ui/base/layout.h"
#include "ui/base/resource/resource_handle.h"
#include "ui/base/ui_base_paths.h"
#include "ui/base/ui_base_switches.h"
#include "ui/gfx/display.h"
#include "ui/gfx/image/image.h"
namespace {
base::FilePath GetResourcesPakFilePath(const std::string& pak_name) {
base::FilePath path;
if (PathService::Get(base::DIR_MODULE, &path))
return path.AppendASCII(pak_name.c_str());
return base::FilePath(pak_name.c_str());
}
}
namespace ui {
void ResourceBundle::LoadCommonResources() {
AddDataPackFromPath(GetResourcesPakFilePath(
"chrome_100_percent.pak"), SCALE_FACTOR_100P);
if (ui::IsScaleFactorSupported(SCALE_FACTOR_200P)) {
AddOptionalDataPackFromPath(GetResourcesPakFilePath(
"chrome_200_percent.pak"), SCALE_FACTOR_200P);
}
}
gfx::Image& ResourceBundle::GetNativeImageNamed(int resource_id, ImageRTL rtl) {
DCHECK_EQ(rtl, RTL_DISABLED);
return GetImageNamed(resource_id);
}
}