OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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/renderer/render_widget.h" | 5 #include "chrome/renderer/render_widget.h" |
6 | 6 |
7 #include <windows.h> | 7 #include <windows.h> |
8 | 8 |
9 #include "base/gfx/point.h" | 9 #include "base/gfx/point.h" |
10 #include "base/gfx/size.h" | 10 #include "base/gfx/size.h" |
(...skipping 336 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
347 } | 347 } |
348 } | 348 } |
349 | 349 |
350 void RenderWidget::ClearFocus() { | 350 void RenderWidget::ClearFocus() { |
351 // We may have got the focus from the browser before this gets processed, in | 351 // We may have got the focus from the browser before this gets processed, in |
352 // which case we do not want to unfocus ourself. | 352 // which case we do not want to unfocus ourself. |
353 if (!has_focus_ && webwidget_) | 353 if (!has_focus_ && webwidget_) |
354 webwidget_->SetFocus(false); | 354 webwidget_->SetFocus(false); |
355 } | 355 } |
356 | 356 |
357 void RenderWidget::PaintRect(const gfx::Rect& rect, SharedMemory* paint_buf) { | 357 void RenderWidget::PaintRect(const gfx::Rect& rect, |
| 358 base::SharedMemory* paint_buf) { |
358 gfx::PlatformCanvasWin canvas(rect.width(), rect.height(), true, | 359 gfx::PlatformCanvasWin canvas(rect.width(), rect.height(), true, |
359 paint_buf->handle()); | 360 paint_buf->handle()); |
360 // Bring the canvas into the coordinate system of the paint rect | 361 // Bring the canvas into the coordinate system of the paint rect |
361 canvas.translate(static_cast<SkScalar>(-rect.x()), | 362 canvas.translate(static_cast<SkScalar>(-rect.x()), |
362 static_cast<SkScalar>(-rect.y())); | 363 static_cast<SkScalar>(-rect.y())); |
363 | 364 |
364 webwidget_->Paint(&canvas, rect); | 365 webwidget_->Paint(&canvas, rect); |
365 | 366 |
366 // Flush to underlying bitmap. TODO(darin): is this needed? | 367 // Flush to underlying bitmap. TODO(darin): is this needed? |
367 canvas.getTopPlatformDevice().accessBitmap(false); | 368 canvas.getTopPlatformDevice().accessBitmap(false); |
(...skipping 390 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
758 for (; i < plugin_window_moves_.size(); ++i) { | 759 for (; i < plugin_window_moves_.size(); ++i) { |
759 if (plugin_window_moves_[i].window == move.window) { | 760 if (plugin_window_moves_[i].window == move.window) { |
760 plugin_window_moves_[i] = move; | 761 plugin_window_moves_[i] = move; |
761 break; | 762 break; |
762 } | 763 } |
763 } | 764 } |
764 | 765 |
765 if (i == plugin_window_moves_.size()) | 766 if (i == plugin_window_moves_.size()) |
766 plugin_window_moves_.push_back(move); | 767 plugin_window_moves_.push_back(move); |
767 } | 768 } |
OLD | NEW |