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

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

Issue 10270023: Add new ResourceBundle::Delegate interface. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 7 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
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 #include "ui/base/resource/resource_handle.h" 14 #include "ui/base/resource/resource_handle.h"
15 15
16 namespace { 16 namespace {
17 17
18 FilePath GetResourcesPakFilePath(const std::string& pak_name) { 18 FilePath GetResourcesPakFilePath(const std::string& pak_name) {
19 FilePath path; 19 FilePath path;
20 PathService::Get(base::DIR_ANDROID_APP_DATA, &path); 20 PathService::Get(base::DIR_ANDROID_APP_DATA, &path);
21 DCHECK(!path.empty()); 21 DCHECK(!path.empty());
22 return path.AppendASCII("paks").AppendASCII(pak_name.c_str()); 22 return path.AppendASCII("paks").AppendASCII(pak_name.c_str());
23 } 23 }
24 24
25 } // namespace 25 } // namespace
26 26
27 namespace ui { 27 namespace ui {
28 28
29 void ResourceBundle::LoadCommonResources() { 29 void ResourceBundle::LoadCommonResources() {
30 AddDataPack(GetResourcesPakFilePath("chrome.pak"), 30 AddDataPack("chrome",
31 GetResourcesPakFilePath("chrome.pak"),
31 ResourceHandle::kScaleFactor100x); 32 ResourceHandle::kScaleFactor100x);
32 AddDataPack(GetResourcesPakFilePath("theme_resources_standard.pak"), 33 AddDataPack("theme_resources_standard",
34 GetResourcesPakFilePath("theme_resources_standard.pak"),
33 ResourceHandle::kScaleFactor100x); 35 ResourceHandle::kScaleFactor100x);
34 AddDataPack(GetResourcesPakFilePath("ui_resources_standard.pak"), 36 AddDataPack("ui_resources_standard",
37 GetResourcesPakFilePath("ui_resources_standard.pak"),
35 ResourceHandle::kScaleFactor100x); 38 ResourceHandle::kScaleFactor100x);
36 } 39 }
37 40
38 gfx::Image& ResourceBundle::GetNativeImageNamed(int resource_id, ImageRTL rtl) { 41 gfx::Image& ResourceBundle::GetNativeImageNamed(int resource_id, ImageRTL rtl) {
39 // Flipped image is not used on Android. 42 // Flipped image is not used on Android.
40 DCHECK_EQ(rtl, RTL_DISABLED); 43 DCHECK_EQ(rtl, RTL_DISABLED);
41 return GetImageNamed(resource_id); 44 return GetImageNamed(resource_id);
42 } 45 }
43 46
44 } 47 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698