| 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/browser/renderer_host/render_widget_host_view_gtk.h" | 5 #include "chrome/browser/renderer_host/render_widget_host_view_gtk.h" |
| 6 | 6 |
| 7 // If this gets included after the gtk headers, then a bunch of compiler | 7 // If this gets included after the gtk headers, then a bunch of compiler |
| 8 // errors happen because of a "#define Status int" in Xlib.h, which interacts | 8 // errors happen because of a "#define Status int" in Xlib.h, which interacts |
| 9 // badly with URLRequestStatus::Status. | 9 // badly with URLRequestStatus::Status. |
| 10 #include "chrome/common/render_messages.h" | 10 #include "chrome/common/render_messages.h" |
| (...skipping 487 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 498 if (current_cursor_.GetCursorType() == GDK_LAST_CURSOR) | 498 if (current_cursor_.GetCursorType() == GDK_LAST_CURSOR) |
| 499 ShowCurrentCursor(); | 499 ShowCurrentCursor(); |
| 500 } | 500 } |
| 501 | 501 |
| 502 void RenderWidgetHostViewGtk::IMEUpdateStatus(int control, | 502 void RenderWidgetHostViewGtk::IMEUpdateStatus(int control, |
| 503 const gfx::Rect& caret_rect) { | 503 const gfx::Rect& caret_rect) { |
| 504 im_context_->UpdateStatus(control, caret_rect); | 504 im_context_->UpdateStatus(control, caret_rect); |
| 505 key_bindings_handler_->set_enabled(control != IME_DISABLE); | 505 key_bindings_handler_->set_enabled(control != IME_DISABLE); |
| 506 } | 506 } |
| 507 | 507 |
| 508 void RenderWidgetHostViewGtk::DidPaintBackingStoreRects( | 508 void RenderWidgetHostViewGtk::DidPaintRect(const gfx::Rect& rect) { |
| 509 const std::vector<gfx::Rect>& rects) { | |
| 510 if (is_hidden_) | 509 if (is_hidden_) |
| 511 return; | 510 return; |
| 512 | 511 |
| 513 for (size_t i = 0; i < rects.size(); ++i) { | 512 if (about_to_validate_and_paint_) |
| 514 if (about_to_validate_and_paint_) { | 513 invalid_rect_ = invalid_rect_.Union(rect); |
| 515 invalid_rect_ = invalid_rect_.Union(rects[i]); | 514 else |
| 516 } else { | 515 Paint(rect); |
| 517 Paint(rects[i]); | |
| 518 } | |
| 519 } | |
| 520 } | 516 } |
| 521 | 517 |
| 522 void RenderWidgetHostViewGtk::DidScrollBackingStoreRect(const gfx::Rect& rect, | 518 void RenderWidgetHostViewGtk::DidScrollRect(const gfx::Rect& rect, int dx, |
| 523 int dx, int dy) { | 519 int dy) { |
| 524 if (is_hidden_) | 520 if (is_hidden_) |
| 525 return; | 521 return; |
| 526 | 522 |
| 527 // TODO(darin): Implement the equivalent of Win32's ScrollWindowEX. Can that | |
| 528 // be done using XCopyArea? Perhaps similar to BackingStore::ScrollRect? | |
| 529 Paint(rect); | 523 Paint(rect); |
| 530 } | 524 } |
| 531 | 525 |
| 532 void RenderWidgetHostViewGtk::RenderViewGone() { | 526 void RenderWidgetHostViewGtk::RenderViewGone() { |
| 533 Destroy(); | 527 Destroy(); |
| 534 plugin_container_manager_.set_host_widget(NULL); | 528 plugin_container_manager_.set_host_widget(NULL); |
| 535 } | 529 } |
| 536 | 530 |
| 537 void RenderWidgetHostViewGtk::Destroy() { | 531 void RenderWidgetHostViewGtk::Destroy() { |
| 538 // If |parent_| is non-null, we are a popup and we must disconnect from our | 532 // If |parent_| is non-null, we are a popup and we must disconnect from our |
| (...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 693 const NativeWebKeyboardEvent& event) { | 687 const NativeWebKeyboardEvent& event) { |
| 694 if (!host_) | 688 if (!host_) |
| 695 return; | 689 return; |
| 696 | 690 |
| 697 EditCommands edit_commands; | 691 EditCommands edit_commands; |
| 698 if (key_bindings_handler_->Match(event, &edit_commands)) { | 692 if (key_bindings_handler_->Match(event, &edit_commands)) { |
| 699 host_->ForwardEditCommandsForNextKeyEvent(edit_commands); | 693 host_->ForwardEditCommandsForNextKeyEvent(edit_commands); |
| 700 } | 694 } |
| 701 host_->ForwardKeyboardEvent(event); | 695 host_->ForwardKeyboardEvent(event); |
| 702 } | 696 } |
| OLD | NEW |