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 <cairo/cairo.h> | 7 #include <cairo/cairo.h> |
8 #include <gtk/gtk.h> | 8 #include <gtk/gtk.h> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 310 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
321 }; | 321 }; |
322 GdkWindow* window = view_->window; | 322 GdkWindow* window = view_->window; |
323 gdk_window_invalidate_rect(window, &grect, 0); | 323 gdk_window_invalidate_rect(window, &grect, 0); |
324 } | 324 } |
325 | 325 |
326 WebWidgetHost::WebWidgetHost() | 326 WebWidgetHost::WebWidgetHost() |
327 : view_(NULL), | 327 : view_(NULL), |
328 webwidget_(NULL), | 328 webwidget_(NULL), |
329 scroll_dx_(0), | 329 scroll_dx_(0), |
330 scroll_dy_(0), | 330 scroll_dy_(0), |
331 ALLOW_THIS_IN_INITIALIZER_LIST(weak_factory_(this)) { | 331 weak_factory_(this) { |
332 set_painting(false); | 332 set_painting(false); |
333 } | 333 } |
334 | 334 |
335 WebWidgetHost::~WebWidgetHost() { | 335 WebWidgetHost::~WebWidgetHost() { |
336 // We may be deleted before the view_. Clear out the signals so that we don't | 336 // We may be deleted before the view_. Clear out the signals so that we don't |
337 // attempt to invoke something on a deleted object. | 337 // attempt to invoke something on a deleted object. |
338 g_object_set_data(G_OBJECT(view_), kWebWidgetHostKey, NULL); | 338 g_object_set_data(G_OBJECT(view_), kWebWidgetHostKey, NULL); |
339 g_signal_handlers_disconnect_matched(view_, | 339 g_signal_handlers_disconnect_matched(view_, |
340 G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, this); | 340 G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, this); |
341 webwidget_->close(); | 341 webwidget_->close(); |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
427 | 427 |
428 void WebWidgetHost::PaintRect(const gfx::Rect& rect) { | 428 void WebWidgetHost::PaintRect(const gfx::Rect& rect) { |
429 set_painting(true); | 429 set_painting(true); |
430 webwidget_->paint(canvas_.get(), rect); | 430 webwidget_->paint(canvas_.get(), rect); |
431 set_painting(false); | 431 set_painting(false); |
432 } | 432 } |
433 | 433 |
434 void WebWidgetHost::WindowDestroyed() { | 434 void WebWidgetHost::WindowDestroyed() { |
435 delete this; | 435 delete this; |
436 } | 436 } |
OLD | NEW |