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 2295 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2306 | 2306 |
2307 // Draw the selected portion of the stroke. | 2307 // Draw the selected portion of the stroke. |
2308 if (!selection_rect.isEmpty() && canvas.clipRect(selection_rect)) { | 2308 if (!selection_rect.isEmpty() && canvas.clipRect(selection_rect)) { |
2309 paint.setColor(LocationBarView::GetColor(security_level_, | 2309 paint.setColor(LocationBarView::GetColor(security_level_, |
2310 LocationBarView::SELECTED_TEXT)); | 2310 LocationBarView::SELECTED_TEXT)); |
2311 canvas.drawLine(start_point.fX, start_point.fY, | 2311 canvas.drawLine(start_point.fX, start_point.fY, |
2312 end_point.fX, end_point.fY, paint); | 2312 end_point.fX, end_point.fY, paint); |
2313 } | 2313 } |
2314 | 2314 |
2315 // Now copy what we drew to the target HDC. | 2315 // Now copy what we drew to the target HDC. |
2316 canvas.getTopPlatformDevice().drawToHDC(hdc, | 2316 skia::DrawToNativeContext(&canvas, hdc, |
2317 scheme_rect.left + canvas_paint_clip_rect.left - canvas_clip_rect.left, | 2317 scheme_rect.left + canvas_paint_clip_rect.left - canvas_clip_rect.left, |
2318 std::max(scheme_rect.top, client_rect.top) + canvas_paint_clip_rect.top - | 2318 std::max(scheme_rect.top, client_rect.top) + canvas_paint_clip_rect.top - |
2319 canvas_clip_rect.top, &canvas_paint_clip_rect); | 2319 canvas_clip_rect.top, &canvas_paint_clip_rect); |
2320 } | 2320 } |
2321 | 2321 |
2322 void OmniboxViewWin::DrawDropHighlight(HDC hdc, | 2322 void OmniboxViewWin::DrawDropHighlight(HDC hdc, |
2323 const CRect& client_rect, | 2323 const CRect& client_rect, |
2324 const CRect& paint_clip_rect) { | 2324 const CRect& paint_clip_rect) { |
2325 DCHECK_NE(-1, drop_highlight_position_); | 2325 DCHECK_NE(-1, drop_highlight_position_); |
2326 | 2326 |
(...skipping 268 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2595 // PosFromChar(i) might return 0 when i is greater than 1. | 2595 // PosFromChar(i) might return 0 when i is greater than 1. |
2596 return font_.GetStringWidth(text) + GetHorizontalMargin(); | 2596 return font_.GetStringWidth(text) + GetHorizontalMargin(); |
2597 } | 2597 } |
2598 | 2598 |
2599 bool OmniboxViewWin::IsCaretAtEnd() const { | 2599 bool OmniboxViewWin::IsCaretAtEnd() const { |
2600 long length = GetTextLength(); | 2600 long length = GetTextLength(); |
2601 CHARRANGE sel; | 2601 CHARRANGE sel; |
2602 GetSelection(sel); | 2602 GetSelection(sel); |
2603 return sel.cpMin == sel.cpMax && sel.cpMin == length; | 2603 return sel.cpMin == sel.cpMax && sel.cpMin == length; |
2604 } | 2604 } |
OLD | NEW |