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

Unified Diff: ui/views/mus/aura_init.cc

Issue 2361943002: Add 2x icons resources to mash. (Closed)
Patch Set: Use default arg. Created 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/views/mus/aura_init.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/mus/aura_init.cc
diff --git a/ui/views/mus/aura_init.cc b/ui/views/mus/aura_init.cc
index 26eb071349fcc23b55971698c4647d9e7620fda0..2d0981b9e1aaafa8790fadb890dec96ee9362e78 100644
--- a/ui/views/mus/aura_init.cc
+++ b/ui/views/mus/aura_init.cc
@@ -27,12 +27,6 @@ namespace views {
namespace {
-std::set<std::string> GetResourcePaths(const std::string& resource_file) {
- std::set<std::string> paths;
- paths.insert(resource_file);
- return paths;
-}
-
class MusViewsDelegate : public ViewsDelegate {
public:
MusViewsDelegate() {}
@@ -52,8 +46,10 @@ class MusViewsDelegate : public ViewsDelegate {
} // namespace
AuraInit::AuraInit(shell::Connector* connector,
- const std::string& resource_file)
+ const std::string& resource_file,
+ const std::string& resource_file_200)
: resource_file_(resource_file),
+ resource_file_200_(resource_file_200),
env_(aura::Env::CreateInstance()),
views_delegate_(new MusViewsDelegate) {
ui::MaterialDesignController::Initialize();
@@ -77,11 +73,15 @@ AuraInit::~AuraInit() {
void AuraInit::InitializeResources(shell::Connector* connector) {
if (ui::ResourceBundle::HasSharedInstance())
return;
+
+ std::set<std::string> resource_paths({resource_file_});
+ if (!resource_file_200_.empty())
+ resource_paths.insert(resource_file_200_);
+
catalog::ResourceLoader loader;
filesystem::mojom::DirectoryPtr directory;
connector->ConnectToInterface("mojo:catalog", &directory);
- CHECK(loader.OpenFiles(std::move(directory),
- GetResourcePaths(resource_file_)));
+ CHECK(loader.OpenFiles(std::move(directory), resource_paths));
ui::RegisterPathProvider();
base::File pak_file = loader.TakeFile(resource_file_);
base::File pak_file_2 = pak_file.Duplicate();
@@ -89,6 +89,9 @@ void AuraInit::InitializeResources(shell::Connector* connector) {
std::move(pak_file), base::MemoryMappedFile::Region::kWholeFile);
ui::ResourceBundle::GetSharedInstance().AddDataPackFromFile(
std::move(pak_file_2), ui::SCALE_FACTOR_100P);
+ if (!resource_file_200_.empty())
+ ui::ResourceBundle::GetSharedInstance().AddDataPackFromFile(
+ loader.TakeFile(resource_file_200_), ui::SCALE_FACTOR_200P);
// Initialize the skia font code to go ask fontconfig underneath.
#if defined(OS_LINUX)
« no previous file with comments | « ui/views/mus/aura_init.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698