| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 "views/controls/button/text_button.h" | 5 #include "views/controls/button/text_button.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "app/resource_bundle.h" | 9 #include "app/resource_bundle.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 342 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 353 | 353 |
| 354 if (for_drag) { | 354 if (for_drag) { |
| 355 #if defined(OS_WIN) | 355 #if defined(OS_WIN) |
| 356 // TODO(erg): Either port DrawStringWithHalo to linux or find an | 356 // TODO(erg): Either port DrawStringWithHalo to linux or find an |
| 357 // alternative here. | 357 // alternative here. |
| 358 canvas->AsCanvasSkia()->DrawStringWithHalo( | 358 canvas->AsCanvasSkia()->DrawStringWithHalo( |
| 359 text_, font_, text_color, color_highlight_, text_bounds.x(), | 359 text_, font_, text_color, color_highlight_, text_bounds.x(), |
| 360 text_bounds.y(), text_bounds.width(), text_bounds.height(), | 360 text_bounds.y(), text_bounds.width(), text_bounds.height(), |
| 361 draw_string_flags); | 361 draw_string_flags); |
| 362 #else | 362 #else |
| 363 canvas->DrawStringInt(UTF16ToWideHack(text_), | 363 canvas->DrawStringInt(text_, |
| 364 font_, | 364 font_, |
| 365 text_color, | 365 text_color, |
| 366 text_bounds.x(), | 366 text_bounds.x(), |
| 367 text_bounds.y(), | 367 text_bounds.y(), |
| 368 text_bounds.width(), | 368 text_bounds.width(), |
| 369 text_bounds.height(), | 369 text_bounds.height(), |
| 370 draw_string_flags); | 370 draw_string_flags); |
| 371 #endif | 371 #endif |
| 372 } else if (has_text_halo_) { | 372 } else if (has_text_halo_) { |
| 373 canvas->AsCanvasSkia()->DrawStringWithHalo( | 373 canvas->AsCanvasSkia()->DrawStringWithHalo( |
| 374 UTF16ToWideHack(text_), font_, text_color, text_halo_color_, | 374 text_, font_, text_color, text_halo_color_, |
| 375 text_bounds.x(), text_bounds.y(), text_bounds.width(), | 375 text_bounds.x(), text_bounds.y(), text_bounds.width(), |
| 376 text_bounds.height(), draw_string_flags); | 376 text_bounds.height(), draw_string_flags); |
| 377 } else { | 377 } else { |
| 378 canvas->DrawStringInt(UTF16ToWideHack(text_), | 378 canvas->DrawStringInt(text_, |
| 379 font_, | 379 font_, |
| 380 text_color, | 380 text_color, |
| 381 text_bounds.x(), | 381 text_bounds.x(), |
| 382 text_bounds.y(), | 382 text_bounds.y(), |
| 383 text_bounds.width(), | 383 text_bounds.width(), |
| 384 text_bounds.height(), | 384 text_bounds.height(), |
| 385 draw_string_flags); | 385 draw_string_flags); |
| 386 } | 386 } |
| 387 } | 387 } |
| 388 | 388 |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 455 | 455 |
| 456 std::string TextButton::GetClassName() const { | 456 std::string TextButton::GetClassName() const { |
| 457 return kViewClassName; | 457 return kViewClassName; |
| 458 } | 458 } |
| 459 | 459 |
| 460 void TextButton::Paint(gfx::Canvas* canvas) { | 460 void TextButton::Paint(gfx::Canvas* canvas) { |
| 461 Paint(canvas, false); | 461 Paint(canvas, false); |
| 462 } | 462 } |
| 463 | 463 |
| 464 } // namespace views | 464 } // namespace views |
| OLD | NEW |