| OLD | NEW |
| 1 // Copyright (c) 2006-2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2009 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 "chrome/common/resource_bundle.h" | 5 #include "chrome/common/resource_bundle.h" |
| 6 | 6 |
| 7 #include "base/gfx/png_decoder.h" | 7 #include "base/gfx/png_decoder.h" |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "base/string_piece.h" | 9 #include "base/string_piece.h" |
| 10 #include "net/base/file_stream.h" | 10 #include "net/base/file_stream.h" |
| (...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 178 | 178 |
| 179 medium_font_.reset(new ChromeFont()); | 179 medium_font_.reset(new ChromeFont()); |
| 180 *medium_font_ = base_font_->DeriveFont(3); | 180 *medium_font_ = base_font_->DeriveFont(3); |
| 181 | 181 |
| 182 medium_bold_font_.reset(new ChromeFont()); | 182 medium_bold_font_.reset(new ChromeFont()); |
| 183 *medium_bold_font_ = | 183 *medium_bold_font_ = |
| 184 base_font_->DeriveFont(3, base_font_->style() | ChromeFont::BOLD); | 184 base_font_->DeriveFont(3, base_font_->style() | ChromeFont::BOLD); |
| 185 | 185 |
| 186 large_font_.reset(new ChromeFont()); | 186 large_font_.reset(new ChromeFont()); |
| 187 *large_font_ = base_font_->DeriveFont(8); | 187 *large_font_ = base_font_->DeriveFont(8); |
| 188 | |
| 189 web_font_.reset(new ChromeFont()); | |
| 190 *web_font_ = base_font_->DeriveFont(1, | |
| 191 base_font_->style() | ChromeFont::WEB); | |
| 192 } | 188 } |
| 193 } | 189 } |
| 194 | 190 |
| 195 ChromeFont ResourceBundle::GetFont(FontStyle style) { | 191 ChromeFont ResourceBundle::GetFont(FontStyle style) { |
| 196 LoadFontsIfNecessary(); | 192 LoadFontsIfNecessary(); |
| 197 switch(style) { | 193 switch(style) { |
| 198 case SmallFont: | 194 case SmallFont: |
| 199 return *small_font_; | 195 return *small_font_; |
| 200 case MediumFont: | 196 case MediumFont: |
| 201 return *medium_font_; | 197 return *medium_font_; |
| 202 case MediumBoldFont: | 198 case MediumBoldFont: |
| 203 return *medium_bold_font_; | 199 return *medium_bold_font_; |
| 204 case LargeFont: | 200 case LargeFont: |
| 205 return *large_font_; | 201 return *large_font_; |
| 206 case WebFont: | |
| 207 return *web_font_; | |
| 208 default: | 202 default: |
| 209 return *base_font_; | 203 return *base_font_; |
| 210 } | 204 } |
| 211 } | 205 } |
| OLD | NEW |