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

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

Issue 6263008: Move ResourceBundle, DataPack to ui/base (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 years, 11 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 | « ui/base/resource/resource_bundle_mac.mm ('k') | ui/base/resource/resource_bundle_win.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) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 "app/resource_bundle.h" 5 #include "ui/base/resource/resource_bundle.h"
6 6
7 #include "app/data_pack.h"
8 #include "app/l10n_util.h" 7 #include "app/l10n_util.h"
9 #include "base/lock.h" 8 #include "base/lock.h"
10 #include "base/logging.h" 9 #include "base/logging.h"
11 #include "base/stl_util-inl.h" 10 #include "base/stl_util-inl.h"
12 #include "base/string16.h" 11 #include "base/string16.h"
13 #include "base/string_piece.h" 12 #include "base/string_piece.h"
14 #include "gfx/font.h" 13 #include "gfx/font.h"
14 #include "ui/base/resource/data_pack.h"
15
16 namespace ui {
15 17
16 namespace { 18 namespace {
17 19
18 app::DataPack* LoadResourcesDataPak(FilePath resources_pak_path) { 20 DataPack* LoadResourcesDataPak(FilePath resources_pak_path) {
19 app::DataPack* resources_pak = new app::DataPack; 21 DataPack* resources_pak = new DataPack;
20 bool success = resources_pak->Load(resources_pak_path); 22 bool success = resources_pak->Load(resources_pak_path);
21 if (!success) { 23 if (!success) {
22 delete resources_pak; 24 delete resources_pak;
23 resources_pak = NULL; 25 resources_pak = NULL;
24 } 26 }
25 return resources_pak; 27 return resources_pak;
26 } 28 }
27 29
28 } // namespace 30 } // namespace
29 31
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
108 FilePath locale_file_path = GetLocaleFilePath(app_locale); 110 FilePath locale_file_path = GetLocaleFilePath(app_locale);
109 if (locale_file_path.empty()) { 111 if (locale_file_path.empty()) {
110 // It's possible that there is no locale.pak. 112 // It's possible that there is no locale.pak.
111 NOTREACHED(); 113 NOTREACHED();
112 return std::string(); 114 return std::string();
113 } 115 }
114 locale_resources_data_ = LoadResourcesDataPak(locale_file_path); 116 locale_resources_data_ = LoadResourcesDataPak(locale_file_path);
115 CHECK(locale_resources_data_) << "failed to load locale.pak"; 117 CHECK(locale_resources_data_) << "failed to load locale.pak";
116 return app_locale; 118 return app_locale;
117 } 119 }
120
121 } // namespace ui
OLDNEW
« no previous file with comments | « ui/base/resource/resource_bundle_mac.mm ('k') | ui/base/resource/resource_bundle_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698