| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "components/test_runner/mock_web_theme_engine.h" | 5 #include "content/shell/test_runner/mock_web_theme_engine.h" |
| 6 | 6 |
| 7 #if !defined(OS_MACOSX) | 7 #if !defined(OS_MACOSX) |
| 8 | 8 |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "build/build_config.h" | 10 #include "build/build_config.h" |
| 11 #include "cc/paint/paint_canvas.h" | 11 #include "cc/paint/paint_canvas.h" |
| 12 #include "cc/paint/paint_flags.h" | 12 #include "cc/paint/paint_flags.h" |
| 13 #include "third_party/WebKit/public/platform/WebRect.h" | 13 #include "third_party/WebKit/public/platform/WebRect.h" |
| 14 #include "third_party/WebKit/public/platform/WebSize.h" | 14 #include "third_party/WebKit/public/platform/WebSize.h" |
| 15 #include "third_party/skia/include/core/SkPaint.h" | 15 #include "third_party/skia/include/core/SkPaint.h" |
| (...skipping 476 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 492 canvas->drawIRect(irect, flags); | 492 canvas->drawIRect(irect, flags); |
| 493 } | 493 } |
| 494 | 494 |
| 495 // clip the drop-down arrow to be inside the select box | 495 // clip the drop-down arrow to be inside the select box |
| 496 irect.fLeft = | 496 irect.fLeft = |
| 497 std::max(irect.fLeft, extraParams->menuList.arrowX - | 497 std::max(irect.fLeft, extraParams->menuList.arrowX - |
| 498 (extraParams->menuList.arrowSize + 1) / 2); | 498 (extraParams->menuList.arrowSize + 1) / 2); |
| 499 irect.fRight = | 499 irect.fRight = |
| 500 std::min(irect.fLeft + extraParams->menuList.arrowSize, irect.fRight); | 500 std::min(irect.fLeft + extraParams->menuList.arrowSize, irect.fRight); |
| 501 | 501 |
| 502 irect.fTop = extraParams->menuList.arrowY - | 502 irect.fTop = |
| 503 (extraParams->menuList.arrowSize) / 2; | 503 extraParams->menuList.arrowY - (extraParams->menuList.arrowSize) / 2; |
| 504 irect.fBottom = irect.fTop + (extraParams->menuList.arrowSize); | 504 irect.fBottom = irect.fTop + (extraParams->menuList.arrowSize); |
| 505 | 505 |
| 506 halfWidth = irect.width() / 2; | 506 halfWidth = irect.width() / 2; |
| 507 quarterWidth = irect.width() / 4; | 507 quarterWidth = irect.width() / 4; |
| 508 | 508 |
| 509 if (state == WebThemeEngine::StateFocused) // FIXME: draw differenty? | 509 if (state == WebThemeEngine::StateFocused) // FIXME: draw differenty? |
| 510 state = WebThemeEngine::StateNormal; | 510 state = WebThemeEngine::StateNormal; |
| 511 box(canvas, irect, bgColors(state)); | 511 box(canvas, irect, bgColors(state)); |
| 512 triangle(canvas, irect.fLeft + quarterWidth, irect.fTop + quarterWidth, | 512 triangle(canvas, irect.fLeft + quarterWidth, irect.fTop + quarterWidth, |
| 513 irect.fRight - quarterWidth, irect.fTop + quarterWidth, | 513 irect.fRight - quarterWidth, irect.fTop + quarterWidth, |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 601 // part? | 601 // part? |
| 602 // Unfortunately, we can't assert because we don't have access to WTF or | 602 // Unfortunately, we can't assert because we don't have access to WTF or |
| 603 // base. | 603 // base. |
| 604 break; | 604 break; |
| 605 } | 605 } |
| 606 } | 606 } |
| 607 | 607 |
| 608 } // namespace test_runner | 608 } // namespace test_runner |
| 609 | 609 |
| 610 #endif // !defined(OS_MACOSX) | 610 #endif // !defined(OS_MACOSX) |
| OLD | NEW |