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

Side by Side Diff: app/resource_bundle_win.cc

Issue 442002: Share code between Mac and Linux in ResourceBundle. (Closed)
Patch Set: sync Created 11 years 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
« no previous file with comments | « app/resource_bundle_posix.cc ('k') | no next file » | 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) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2008 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 "app/resource_bundle.h"
6 6
7 #include <atlbase.h> 7 #include <atlbase.h>
8 8
9 #include "app/app_paths.h" 9 #include "app/app_paths.h"
10 #include "app/gfx/font.h" 10 #include "app/gfx/font.h"
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
51 return; 51 return;
52 } 52 }
53 53
54 // The dll should only have resources, not executable code. 54 // The dll should only have resources, not executable code.
55 locale_resources_data_ = LoadLibraryEx(locale_path.value().c_str(), NULL, 55 locale_resources_data_ = LoadLibraryEx(locale_path.value().c_str(), NULL,
56 GetDataDllLoadFlags()); 56 GetDataDllLoadFlags());
57 DCHECK(locale_resources_data_ != NULL) << 57 DCHECK(locale_resources_data_ != NULL) <<
58 "unable to load generated resources"; 58 "unable to load generated resources";
59 } 59 }
60 60
61 // static
61 FilePath ResourceBundle::GetLocaleFilePath(const std::wstring& pref_locale) { 62 FilePath ResourceBundle::GetLocaleFilePath(const std::wstring& pref_locale) {
62 FilePath locale_path; 63 FilePath locale_path;
63 PathService::Get(app::DIR_LOCALES, &locale_path); 64 PathService::Get(app::DIR_LOCALES, &locale_path);
64 65
65 const std::string app_locale = l10n_util::GetApplicationLocale(pref_locale); 66 const std::string app_locale = l10n_util::GetApplicationLocale(pref_locale);
66 if (app_locale.empty()) 67 if (app_locale.empty())
67 return FilePath(); 68 return FilePath();
68 69
69 return locale_path.AppendASCII(app_locale + ".dll"); 70 return locale_path.AppendASCII(app_locale + ".dll");
70 } 71 }
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
133 message_id); 134 message_id);
134 if (!image) { 135 if (!image) {
135 StackTrace().PrintBacktrace(); // See http://crbug.com/21925. 136 StackTrace().PrintBacktrace(); // See http://crbug.com/21925.
136 NOTREACHED() << "unable to find resource: " << message_id; 137 NOTREACHED() << "unable to find resource: " << message_id;
137 return std::wstring(); 138 return std::wstring();
138 } 139 }
139 } 140 }
140 // Copy into a string16 and return. 141 // Copy into a string16 and return.
141 return string16(image->achString, image->nLength); 142 return string16(image->achString, image->nLength);
142 } 143 }
OLDNEW
« no previous file with comments | « app/resource_bundle_posix.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698