OLD | NEW |
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 <gtk/gtk.h> | 7 #include <gtk/gtk.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 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
88 | 88 |
89 locale_resources_data_ = new base::DataPack; | 89 locale_resources_data_ = new base::DataPack; |
90 success = locale_resources_data_->Load(locale_path); | 90 success = locale_resources_data_->Load(locale_path); |
91 DCHECK(success) << "failed to load locale pak file"; | 91 DCHECK(success) << "failed to load locale pak file"; |
92 } | 92 } |
93 | 93 |
94 FilePath ResourceBundle::GetLocaleFilePath(const std::wstring& pref_locale) { | 94 FilePath ResourceBundle::GetLocaleFilePath(const std::wstring& pref_locale) { |
95 FilePath locale_path; | 95 FilePath locale_path; |
96 PathService::Get(app::DIR_LOCALES, &locale_path); | 96 PathService::Get(app::DIR_LOCALES, &locale_path); |
97 | 97 |
98 const std::wstring app_locale = l10n_util::GetApplicationLocale(pref_locale); | 98 const std::string app_locale = l10n_util::GetApplicationLocale(pref_locale); |
99 if (app_locale.empty()) | 99 if (app_locale.empty()) |
100 return FilePath(); | 100 return FilePath(); |
101 | 101 |
102 return locale_path.Append(WideToASCII(app_locale + L".pak")); | 102 return locale_path.AppendASCII(app_locale + ".pak"); |
103 } | 103 } |
104 | 104 |
105 void ResourceBundle::LoadThemeResources() { | 105 void ResourceBundle::LoadThemeResources() { |
106 FilePath theme_data_path; | 106 FilePath theme_data_path; |
107 PathService::Get(app::DIR_THEMES, &theme_data_path); | 107 PathService::Get(app::DIR_THEMES, &theme_data_path); |
108 theme_data_path = theme_data_path.Append(FILE_PATH_LITERAL("default.pak")); | 108 theme_data_path = theme_data_path.Append(FILE_PATH_LITERAL("default.pak")); |
109 theme_data_ = new base::DataPack; | 109 theme_data_ = new base::DataPack; |
110 bool success = theme_data_->Load(theme_data_path); | 110 bool success = theme_data_->Load(theme_data_path); |
111 DCHECK(success) << "failed to load theme data"; | 111 DCHECK(success) << "failed to load theme data"; |
112 } | 112 } |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
199 // This bitmap will be leaked, but this code should never be hit. | 199 // This bitmap will be leaked, but this code should never be hit. |
200 scoped_ptr<SkBitmap> skia_bitmap(new SkBitmap()); | 200 scoped_ptr<SkBitmap> skia_bitmap(new SkBitmap()); |
201 skia_bitmap->setConfig(SkBitmap::kARGB_8888_Config, 32, 32); | 201 skia_bitmap->setConfig(SkBitmap::kARGB_8888_Config, 32, 32); |
202 skia_bitmap->allocPixels(); | 202 skia_bitmap->allocPixels(); |
203 skia_bitmap->eraseARGB(255, 255, 0, 0); | 203 skia_bitmap->eraseARGB(255, 255, 0, 0); |
204 empty_bitmap = gfx::GdkPixbufFromSkBitmap(skia_bitmap.get()); | 204 empty_bitmap = gfx::GdkPixbufFromSkBitmap(skia_bitmap.get()); |
205 } | 205 } |
206 return empty_bitmap; | 206 return empty_bitmap; |
207 } | 207 } |
208 } | 208 } |
OLD | NEW |