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 "webkit/tools/test_shell/webwidget_host.h" | 5 #include "webkit/tools/test_shell/webwidget_host.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "skia/ext/platform_canvas.h" | 8 #include "skia/ext/platform_canvas.h" |
9 #include "third_party/WebKit/Source/Platform/chromium/public/WebSize.h" | 9 #include "third_party/WebKit/Source/Platform/chromium/public/WebSize.h" |
10 #include "third_party/WebKit/Source/WebKit/chromium/public/WebInputEvent.h" | 10 #include "third_party/WebKit/Source/WebKit/chromium/public/WebInputEvent.h" |
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
193 void WebWidgetHost::DiscardBackingStore() { | 193 void WebWidgetHost::DiscardBackingStore() { |
194 canvas_.reset(); | 194 canvas_.reset(); |
195 } | 195 } |
196 | 196 |
197 WebWidgetHost::WebWidgetHost() | 197 WebWidgetHost::WebWidgetHost() |
198 : view_(NULL), | 198 : view_(NULL), |
199 webwidget_(NULL), | 199 webwidget_(NULL), |
200 track_mouse_leave_(false), | 200 track_mouse_leave_(false), |
201 scroll_dx_(0), | 201 scroll_dx_(0), |
202 scroll_dy_(0), | 202 scroll_dy_(0), |
203 ALLOW_THIS_IN_INITIALIZER_LIST(weak_factory_(this)) { | 203 weak_factory_(this) { |
204 set_painting(false); | 204 set_painting(false); |
205 } | 205 } |
206 | 206 |
207 WebWidgetHost::~WebWidgetHost() { | 207 WebWidgetHost::~WebWidgetHost() { |
208 ui::SetWindowUserData(view_, 0); | 208 ui::SetWindowUserData(view_, 0); |
209 | 209 |
210 TrackMouseLeave(false); | 210 TrackMouseLeave(false); |
211 | 211 |
212 webwidget_->close(); | 212 webwidget_->close(); |
213 } | 213 } |
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
372 void WebWidgetHost::PaintRect(const gfx::Rect& rect) { | 372 void WebWidgetHost::PaintRect(const gfx::Rect& rect) { |
373 #ifndef NDEBUG | 373 #ifndef NDEBUG |
374 DCHECK(!painting_); | 374 DCHECK(!painting_); |
375 #endif | 375 #endif |
376 DCHECK(canvas_.get()); | 376 DCHECK(canvas_.get()); |
377 | 377 |
378 set_painting(true); | 378 set_painting(true); |
379 webwidget_->paint(canvas_.get(), rect); | 379 webwidget_->paint(canvas_.get(), rect); |
380 set_painting(false); | 380 set_painting(false); |
381 } | 381 } |
OLD | NEW |