| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "content/browser/renderer_host/render_widget_host_view_win.h" | 5 #include "content/browser/renderer_host/render_widget_host_view_win.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <peninputpanel_i.c> | 8 #include <peninputpanel_i.c> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 1131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1142 } | 1142 } |
| 1143 | 1143 |
| 1144 void RenderWidgetHostViewWin::DrawBackground(const RECT& dirty_rect, | 1144 void RenderWidgetHostViewWin::DrawBackground(const RECT& dirty_rect, |
| 1145 CPaintDC* dc) { | 1145 CPaintDC* dc) { |
| 1146 if (!background_.empty()) { | 1146 if (!background_.empty()) { |
| 1147 gfx::Rect dirty_area(dirty_rect); | 1147 gfx::Rect dirty_area(dirty_rect); |
| 1148 gfx::CanvasSkia canvas(dirty_area.size(), true); | 1148 gfx::CanvasSkia canvas(dirty_area.size(), true); |
| 1149 canvas.Translate(gfx::Point().Subtract(dirty_area.origin())); | 1149 canvas.Translate(gfx::Point().Subtract(dirty_area.origin())); |
| 1150 | 1150 |
| 1151 gfx::Rect dc_rect(dc->m_ps.rcPaint); | 1151 gfx::Rect dc_rect(dc->m_ps.rcPaint); |
| 1152 canvas.TileImageInt(background_, 0, 0, dc_rect.width(), dc_rect.height()); | 1152 dc_rect.set_origin(gfx::Point()); |
| 1153 canvas.TileImage(background_, dc_rect); |
| 1153 | 1154 |
| 1154 skia::DrawToNativeContext(canvas.sk_canvas(), *dc, dirty_area.x(), | 1155 skia::DrawToNativeContext(canvas.sk_canvas(), *dc, dirty_area.x(), |
| 1155 dirty_area.y(), NULL); | 1156 dirty_area.y(), NULL); |
| 1156 } else { | 1157 } else { |
| 1157 HBRUSH white_brush = reinterpret_cast<HBRUSH>(GetStockObject(WHITE_BRUSH)); | 1158 HBRUSH white_brush = reinterpret_cast<HBRUSH>(GetStockObject(WHITE_BRUSH)); |
| 1158 dc->FillRect(&dirty_rect, white_brush); | 1159 dc->FillRect(&dirty_rect, white_brush); |
| 1159 } | 1160 } |
| 1160 } | 1161 } |
| 1161 | 1162 |
| 1162 void RenderWidgetHostViewWin::OnNCPaint(HRGN update_region) { | 1163 void RenderWidgetHostViewWin::OnNCPaint(HRGN update_region) { |
| (...skipping 1453 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2616 void RenderWidgetHostViewWin::ResetPointerDownContext() { | 2617 void RenderWidgetHostViewWin::ResetPointerDownContext() { |
| 2617 // If the default focus on the page is on an edit field and we did not | 2618 // If the default focus on the page is on an edit field and we did not |
| 2618 // receive a focus change in the context of a pointer down message, it means | 2619 // receive a focus change in the context of a pointer down message, it means |
| 2619 // that the pointer down message occurred on the edit field and we should | 2620 // that the pointer down message occurred on the edit field and we should |
| 2620 // display the on screen keyboard | 2621 // display the on screen keyboard |
| 2621 if (!received_focus_change_after_pointer_down_ && virtual_keyboard_) | 2622 if (!received_focus_change_after_pointer_down_ && virtual_keyboard_) |
| 2622 DisplayOnScreenKeyboardIfNeeded(); | 2623 DisplayOnScreenKeyboardIfNeeded(); |
| 2623 received_focus_change_after_pointer_down_ = false; | 2624 received_focus_change_after_pointer_down_ = false; |
| 2624 pointer_down_context_ = false; | 2625 pointer_down_context_ = false; |
| 2625 } | 2626 } |
| OLD | NEW |