OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/browser/ui/views/omnibox/omnibox_view_win.h" | 5 #include "chrome/browser/ui/views/omnibox/omnibox_view_win.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <locale> | 8 #include <locale> |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 2297 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2308 | 2308 |
2309 // Draw the selected portion of the stroke. | 2309 // Draw the selected portion of the stroke. |
2310 if (!selection_rect.isEmpty() && canvas.clipRect(selection_rect)) { | 2310 if (!selection_rect.isEmpty() && canvas.clipRect(selection_rect)) { |
2311 paint.setColor(LocationBarView::GetColor(security_level_, | 2311 paint.setColor(LocationBarView::GetColor(security_level_, |
2312 LocationBarView::SELECTED_TEXT)); | 2312 LocationBarView::SELECTED_TEXT)); |
2313 canvas.drawLine(start_point.fX, start_point.fY, | 2313 canvas.drawLine(start_point.fX, start_point.fY, |
2314 end_point.fX, end_point.fY, paint); | 2314 end_point.fX, end_point.fY, paint); |
2315 } | 2315 } |
2316 | 2316 |
2317 // Now copy what we drew to the target HDC. | 2317 // Now copy what we drew to the target HDC. |
2318 canvas.getTopPlatformDevice().drawToHDC(hdc, | 2318 skia::DrawToNativeContext(&canvas, hdc, |
2319 scheme_rect.left + canvas_paint_clip_rect.left - canvas_clip_rect.left, | 2319 scheme_rect.left + canvas_paint_clip_rect.left - canvas_clip_rect.left, |
2320 std::max(scheme_rect.top, client_rect.top) + canvas_paint_clip_rect.top - | 2320 std::max(scheme_rect.top, client_rect.top) + canvas_paint_clip_rect.top - |
2321 canvas_clip_rect.top, &canvas_paint_clip_rect); | 2321 canvas_clip_rect.top, &canvas_paint_clip_rect); |
2322 } | 2322 } |
2323 | 2323 |
2324 void OmniboxViewWin::DrawDropHighlight(HDC hdc, | 2324 void OmniboxViewWin::DrawDropHighlight(HDC hdc, |
2325 const CRect& client_rect, | 2325 const CRect& client_rect, |
2326 const CRect& paint_clip_rect) { | 2326 const CRect& paint_clip_rect) { |
2327 DCHECK_NE(-1, drop_highlight_position_); | 2327 DCHECK_NE(-1, drop_highlight_position_); |
2328 | 2328 |
(...skipping 267 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2596 // PosFromChar(i) might return 0 when i is greater than 1. | 2596 // PosFromChar(i) might return 0 when i is greater than 1. |
2597 return font_.GetStringWidth(text) + GetHorizontalMargin(); | 2597 return font_.GetStringWidth(text) + GetHorizontalMargin(); |
2598 } | 2598 } |
2599 | 2599 |
2600 bool OmniboxViewWin::IsCaretAtEnd() const { | 2600 bool OmniboxViewWin::IsCaretAtEnd() const { |
2601 long length = GetTextLength(); | 2601 long length = GetTextLength(); |
2602 CHARRANGE sel; | 2602 CHARRANGE sel; |
2603 GetSelection(sel); | 2603 GetSelection(sel); |
2604 return sel.cpMin == sel.cpMax && sel.cpMin == length; | 2604 return sel.cpMin == sel.cpMax && sel.cpMin == length; |
2605 } | 2605 } |
OLD | NEW |