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

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

Issue 10151025: Add scale factor tag to data packs (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix build 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
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 "base/path_service.h" 7 #include "base/path_service.h"
8 #include "ui/base/resource/resource_handle.h"
8 #include "ui/base/ui_base_paths.h" 9 #include "ui/base/ui_base_paths.h"
9 10
10 namespace { 11 namespace {
11 12
12 FilePath GetResourcesPakFilePath(const std::string& pak_name) { 13 FilePath GetResourcesPakFilePath(const std::string& pak_name) {
13 FilePath path; 14 FilePath path;
14 if (PathService::Get(base::DIR_MODULE, &path)) 15 if (PathService::Get(base::DIR_MODULE, &path))
15 return path.AppendASCII(pak_name.c_str()); 16 return path.AppendASCII(pak_name.c_str());
16 return FilePath(); 17 return FilePath();
17 } 18 }
18 19
19 } // namespace 20 } // namespace
20 21
21 namespace ui { 22 namespace ui {
22 23
23 void ResourceBundle::LoadCommonResources() { 24 void ResourceBundle::LoadCommonResources() {
24 AddDataPack(GetResourcesPakFilePath("chrome.pak")); 25 AddDataPack(GetResourcesPakFilePath("chrome.pak"),
25 AddDataPack(GetResourcesPakFilePath("theme_resources_standard.pak")); 26 ResourceHandle::kScaleFactor1x);
26 AddDataPack(GetResourcesPakFilePath("ui_resources_standard.pak")); 27 AddDataPack(GetResourcesPakFilePath("theme_resources_standard.pak"),
28 ResourceHandle::kScaleFactor1x);
29 AddDataPack(GetResourcesPakFilePath("ui_resources_standard.pak"),
30 ResourceHandle::kScaleFactor1x);
31
32 #if defined(ENABLE_HIDPI)
33 AddDataPack(GetResourcesPakFilePath("theme_resources_2x.pak"),
34 ResourceHandle::kScaleFactor2x);
35 AddDataPack(GetResourcesPakFilePath("ui_resources_2x.pak"),
36 ResourceHandle::kScaleFactor2x);
37 #endif
27 } 38 }
28 39
29 } // namespace ui 40 } // namespace ui
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698