| 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 #include "content/browser/renderer_host/render_widget_host_view_gtk.h" | 5 #include "content/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 net::URLRequestStatus::Status. | 9 // badly with net::URLRequestStatus::Status. |
| 10 #include "content/common/view_messages.h" | 10 #include "content/common/view_messages.h" |
| (...skipping 847 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 858 // be done using XCopyArea? Perhaps similar to | 858 // be done using XCopyArea? Perhaps similar to |
| 859 // BackingStore::ScrollBackingStore? | 859 // BackingStore::ScrollBackingStore? |
| 860 if (about_to_validate_and_paint_) | 860 if (about_to_validate_and_paint_) |
| 861 invalid_rect_.Union(scroll_rect); | 861 invalid_rect_.Union(scroll_rect); |
| 862 else | 862 else |
| 863 Paint(scroll_rect); | 863 Paint(scroll_rect); |
| 864 | 864 |
| 865 for (size_t i = 0; i < copy_rects.size(); ++i) { | 865 for (size_t i = 0; i < copy_rects.size(); ++i) { |
| 866 // Avoid double painting. NOTE: This is only relevant given the call to | 866 // Avoid double painting. NOTE: This is only relevant given the call to |
| 867 // Paint(scroll_rect) above. | 867 // Paint(scroll_rect) above. |
| 868 gfx::Rect rect = copy_rects[i]; | 868 gfx::Rect rect = gfx::Subtraction(copy_rects[i], scroll_rect); |
| 869 rect.Subtract(scroll_rect); | |
| 870 if (rect.IsEmpty()) | 869 if (rect.IsEmpty()) |
| 871 continue; | 870 continue; |
| 872 | 871 |
| 873 if (about_to_validate_and_paint_) | 872 if (about_to_validate_and_paint_) |
| 874 invalid_rect_.Union(rect); | 873 invalid_rect_.Union(rect); |
| 875 else | 874 else |
| 876 Paint(rect); | 875 Paint(rect); |
| 877 } | 876 } |
| 878 } | 877 } |
| 879 | 878 |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 962 GtkClipboard* x_clipboard = gtk_clipboard_get(GDK_SELECTION_PRIMARY); | 961 GtkClipboard* x_clipboard = gtk_clipboard_get(GDK_SELECTION_PRIMARY); |
| 963 gtk_clipboard_set_text( | 962 gtk_clipboard_set_text( |
| 964 x_clipboard, utf8_selection.c_str(), utf8_selection.length()); | 963 x_clipboard, utf8_selection.c_str(), utf8_selection.length()); |
| 965 } | 964 } |
| 966 | 965 |
| 967 void RenderWidgetHostViewGtk::SelectionBoundsChanged( | 966 void RenderWidgetHostViewGtk::SelectionBoundsChanged( |
| 968 const gfx::Rect& start_rect, | 967 const gfx::Rect& start_rect, |
| 969 WebKit::WebTextDirection start_direction, | 968 WebKit::WebTextDirection start_direction, |
| 970 const gfx::Rect& end_rect, | 969 const gfx::Rect& end_rect, |
| 971 WebKit::WebTextDirection end_direction) { | 970 WebKit::WebTextDirection end_direction) { |
| 972 gfx::Rect combined_rect = start_rect; | 971 im_context_->UpdateCaretBounds(gfx::Union(start_rect, end_rect)); |
| 973 combined_rect.Union(end_rect); | |
| 974 im_context_->UpdateCaretBounds(combined_rect); | |
| 975 } | 972 } |
| 976 | 973 |
| 977 GdkEventButton* RenderWidgetHostViewGtk::GetLastMouseDown() { | 974 GdkEventButton* RenderWidgetHostViewGtk::GetLastMouseDown() { |
| 978 return last_mouse_down_; | 975 return last_mouse_down_; |
| 979 } | 976 } |
| 980 | 977 |
| 981 gfx::NativeView RenderWidgetHostViewGtk::BuildInputMethodsGtkMenu() { | 978 gfx::NativeView RenderWidgetHostViewGtk::BuildInputMethodsGtkMenu() { |
| 982 return im_context_->BuildInputMethodsGtkMenu(); | 979 return im_context_->BuildInputMethodsGtkMenu(); |
| 983 } | 980 } |
| 984 | 981 |
| (...skipping 565 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1550 this)); | 1547 this)); |
| 1551 } | 1548 } |
| 1552 BrowserAccessibilityGtk* root = | 1549 BrowserAccessibilityGtk* root = |
| 1553 browser_accessibility_manager_->GetRoot()->ToBrowserAccessibilityGtk(); | 1550 browser_accessibility_manager_->GetRoot()->ToBrowserAccessibilityGtk(); |
| 1554 | 1551 |
| 1555 atk_object_set_role(root->GetAtkObject(), ATK_ROLE_HTML_CONTAINER); | 1552 atk_object_set_role(root->GetAtkObject(), ATK_ROLE_HTML_CONTAINER); |
| 1556 return root->GetAtkObject(); | 1553 return root->GetAtkObject(); |
| 1557 } | 1554 } |
| 1558 | 1555 |
| 1559 } // namespace content | 1556 } // namespace content |
| OLD | NEW |