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

Unified Diff: ui/base/resource/resource_bundle_mac.mm

Issue 2209363002: Remove material design resource pak infrastructure (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: remove another mac test file Created 4 years, 4 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/base/resource/resource_bundle.cc ('k') | ui/base/resource/resource_bundle_mac_unittest.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/base/resource/resource_bundle_mac.mm
diff --git a/ui/base/resource/resource_bundle_mac.mm b/ui/base/resource/resource_bundle_mac.mm
index 8f5934cece83c4ce09fec9ef6f2451d10d6933e3..2dbe9ea26d63a34c08c34a6aa5f861b286f98eb4 100644
--- a/ui/base/resource/resource_bundle_mac.mm
+++ b/ui/base/resource/resource_bundle_mac.mm
@@ -14,7 +14,6 @@
#include "base/memory/ref_counted_memory.h"
#include "base/strings/sys_string_conversions.h"
#include "base/synchronization/lock.h"
-#include "ui/base/material_design/material_design_controller.h"
#include "ui/base/resource/resource_handle.h"
#include "ui/gfx/image/image.h"
@@ -60,40 +59,6 @@ void ResourceBundle::LoadCommonResources() {
}
}
-void ResourceBundle::LoadMaterialDesignResources() {
- if (!MaterialDesignController::IsModeMaterial()) {
- return;
- }
-
- // The Material Design data packs contain some of the same asset IDs as in
- // the non-Material Design data packs. Set aside the current packs and add the
- // Material Design packs so that they are searched first when a request for an
- // asset is made. The Material Design packs cannot be loaded in
- // LoadCommonResources() because the MaterialDesignController is not always
- // initialized at the time it is called.
- // TODO(shrike) - remove this method and restore loading of Material Design
- // packs to LoadCommonResources() when the MaterialDesignController goes away.
- std::vector<std::unique_ptr<ResourceHandle>> tmp_packs;
- for (auto it = data_packs_.begin(); it != data_packs_.end(); ++it) {
- std::unique_ptr<ResourceHandle> next_pack(*it);
- tmp_packs.push_back(std::move(next_pack));
- }
- data_packs_.weak_clear();
-
- AddMaterialDesignDataPackFromPath(
- GetResourcesPakFilePath(@"chrome_material_100_percent", nil),
- SCALE_FACTOR_100P);
-
- AddOptionalMaterialDesignDataPackFromPath(
- GetResourcesPakFilePath(@"chrome_material_200_percent", nil),
- SCALE_FACTOR_200P);
-
- // Add back the non-Material Design packs so that they serve as a fallback.
- for (auto it = tmp_packs.begin(); it != tmp_packs.end(); ++it) {
- data_packs_.push_back(std::move(*it));
- }
-}
-
base::FilePath ResourceBundle::GetLocaleFilePath(const std::string& app_locale,
bool test_file_exists) {
NSString* mac_locale = base::SysUTF8ToNSString(app_locale);
@@ -145,11 +110,7 @@ gfx::Image& ResourceBundle::GetNativeImageNamed(int resource_id) {
if (image.IsEmpty()) {
base::scoped_nsobject<NSImage> ns_image;
- // Material Design packs are meant to override the standard packs, so
- // search for the image in those packs first.
for (size_t i = 0; i < data_packs_.size(); ++i) {
- if (!data_packs_[i]->HasOnlyMaterialDesignAssets())
- continue;
scoped_refptr<base::RefCountedStaticMemory> data(
data_packs_[i]->GetStaticMemory(resource_id));
if (!data.get())
@@ -174,8 +135,6 @@ gfx::Image& ResourceBundle::GetNativeImageNamed(int resource_id) {
if (image.IsEmpty()) {
base::scoped_nsobject<NSImage> ns_image;
for (size_t i = 0; i < data_packs_.size(); ++i) {
- if (data_packs_[i]->HasOnlyMaterialDesignAssets())
- continue;
scoped_refptr<base::RefCountedStaticMemory> data(
data_packs_[i]->GetStaticMemory(resource_id));
if (!data.get())
« no previous file with comments | « ui/base/resource/resource_bundle.cc ('k') | ui/base/resource/resource_bundle_mac_unittest.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698