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

Side by Side Diff: ui/base/resource/resource_bundle_android.cc

Issue 10103022: Revert 132517 - Metro/HiDPI: Move 1x icons into separate pak file (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 8 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/tools/build/win/release.rules ('k') | ui/base/resource/resource_bundle_linux.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ui/base/resource/resource_bundle.h" 5 #include "ui/base/resource/resource_bundle.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/file_path.h" 9 #include "base/file_path.h"
10 #include "base/file_util.h" 10 #include "base/file_util.h"
11 #include "base/logging.h" 11 #include "base/logging.h"
12 #include "base/path_service.h" 12 #include "base/path_service.h"
13 #include "base/stringprintf.h" 13 #include "base/stringprintf.h"
14 14
15 namespace {
16
17 FilePath GetResourcesPakFilePath(const std::string& pak_name) {
18 FilePath path;
19 PathService::Get(base::DIR_ANDROID_APP_DATA, &path);
20 DCHECK(!path.empty());
21 return path.AppendASCII("paks").AppendASCII(pak_name.c_str());
22 }
23
24 } // namespace
25
26 namespace ui { 15 namespace ui {
27 16
28 void ResourceBundle::LoadCommonResources() { 17 void ResourceBundle::LoadCommonResources() {
29 AddDataPack(GetResourcesPakFilePath("chrome.pak")); 18 FilePath data_path;
30 AddDataPack(GetResourcesPakFilePath("theme_resources_standard.pak")); 19 PathService::Get(base::DIR_ANDROID_APP_DATA, &data_path);
31 AddDataPack(GetResourcesPakFilePath("ui_resources_standard.pak")); 20 DCHECK(!data_path.empty());
21 data_path = data_path.AppendASCII("paks").AppendASCII("chrome.pak");
22 AddDataPack(data_path);
32 } 23 }
33 24
34 gfx::Image& ResourceBundle::GetNativeImageNamed(int resource_id, ImageRTL rtl) { 25 gfx::Image& ResourceBundle::GetNativeImageNamed(int resource_id, ImageRTL rtl) {
35 // Flipped image is not used on Android. 26 // Flipped image is not used on Android.
36 DCHECK_EQ(rtl, RTL_DISABLED); 27 DCHECK_EQ(rtl, RTL_DISABLED);
37 return GetImageNamed(resource_id); 28 return GetImageNamed(resource_id);
38 } 29 }
39 30
40 } 31 }
OLDNEW
« no previous file with comments | « chrome/tools/build/win/release.rules ('k') | ui/base/resource/resource_bundle_linux.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698