| 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 #import <Cocoa/Cocoa.h> | 5 #import <Cocoa/Cocoa.h> |
| 6 | 6 |
| 7 #include "webkit/tools/test_shell/webwidget_host.h" | 7 #include "webkit/tools/test_shell/webwidget_host.h" |
| 8 | 8 |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "skia/ext/platform_canvas.h" | 10 #include "skia/ext/platform_canvas.h" |
| (...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 143 | 143 |
| 144 void WebWidgetHost::DiscardBackingStore() { | 144 void WebWidgetHost::DiscardBackingStore() { |
| 145 canvas_.reset(); | 145 canvas_.reset(); |
| 146 } | 146 } |
| 147 | 147 |
| 148 WebWidgetHost::WebWidgetHost() | 148 WebWidgetHost::WebWidgetHost() |
| 149 : view_(NULL), | 149 : view_(NULL), |
| 150 webwidget_(NULL), | 150 webwidget_(NULL), |
| 151 scroll_dx_(0), | 151 scroll_dx_(0), |
| 152 scroll_dy_(0), | 152 scroll_dy_(0), |
| 153 ALLOW_THIS_IN_INITIALIZER_LIST(weak_factory_(this)) { | 153 weak_factory_(this) { |
| 154 set_painting(false); | 154 set_painting(false); |
| 155 } | 155 } |
| 156 | 156 |
| 157 WebWidgetHost::~WebWidgetHost() { | 157 WebWidgetHost::~WebWidgetHost() { |
| 158 // ui::SetWindowUserData(hwnd_, 0); | 158 // ui::SetWindowUserData(hwnd_, 0); |
| 159 | 159 |
| 160 webwidget_->close(); | 160 webwidget_->close(); |
| 161 } | 161 } |
| 162 | 162 |
| 163 void WebWidgetHost::UpdatePaintRect(const gfx::Rect& rect) { | 163 void WebWidgetHost::UpdatePaintRect(const gfx::Rect& rect) { |
| (...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 277 void WebWidgetHost::PaintRect(const gfx::Rect& rect) { | 277 void WebWidgetHost::PaintRect(const gfx::Rect& rect) { |
| 278 #ifndef NDEBUG | 278 #ifndef NDEBUG |
| 279 DCHECK(!painting_); | 279 DCHECK(!painting_); |
| 280 #endif | 280 #endif |
| 281 DCHECK(canvas_.get()); | 281 DCHECK(canvas_.get()); |
| 282 | 282 |
| 283 set_painting(true); | 283 set_painting(true); |
| 284 webwidget_->paint(webkit_glue::ToWebCanvas(canvas_.get()), rect); | 284 webwidget_->paint(webkit_glue::ToWebCanvas(canvas_.get()), rect); |
| 285 set_painting(false); | 285 set_painting(false); |
| 286 } | 286 } |
| OLD | NEW |