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 740 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
751 gfx::NativeViewId RenderWidgetHostViewGtk::GetNativeViewId() const { | 751 gfx::NativeViewId RenderWidgetHostViewGtk::GetNativeViewId() const { |
752 return GtkNativeViewManager::GetInstance()->GetIdForWidget(view_.get()); | 752 return GtkNativeViewManager::GetInstance()->GetIdForWidget(view_.get()); |
753 } | 753 } |
754 | 754 |
755 gfx::NativeViewAccessible RenderWidgetHostViewGtk::GetNativeViewAccessible() { | 755 gfx::NativeViewAccessible RenderWidgetHostViewGtk::GetNativeViewAccessible() { |
756 NOTIMPLEMENTED(); | 756 NOTIMPLEMENTED(); |
757 return NULL; | 757 return NULL; |
758 } | 758 } |
759 | 759 |
760 void RenderWidgetHostViewGtk::MovePluginWindows( | 760 void RenderWidgetHostViewGtk::MovePluginWindows( |
761 const gfx::Point& scroll_offset, | 761 const gfx::Vector2d& scroll_offset, |
762 const std::vector<webkit::npapi::WebPluginGeometry>& moves) { | 762 const std::vector<webkit::npapi::WebPluginGeometry>& moves) { |
763 for (size_t i = 0; i < moves.size(); ++i) { | 763 for (size_t i = 0; i < moves.size(); ++i) { |
764 plugin_container_manager_.MovePluginContainer(moves[i]); | 764 plugin_container_manager_.MovePluginContainer(moves[i]); |
765 } | 765 } |
766 } | 766 } |
767 | 767 |
768 void RenderWidgetHostViewGtk::Focus() { | 768 void RenderWidgetHostViewGtk::Focus() { |
769 gtk_widget_grab_focus(view_.get()); | 769 gtk_widget_grab_focus(view_.get()); |
770 } | 770 } |
771 | 771 |
(...skipping 262 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1034 | 1034 |
1035 // NOTE: |output| is initialized with the size of |src_subrect|, and |dst_size| | 1035 // NOTE: |output| is initialized with the size of |src_subrect|, and |dst_size| |
1036 // is ignored on GTK. | 1036 // is ignored on GTK. |
1037 void RenderWidgetHostViewGtk::CopyFromCompositingSurface( | 1037 void RenderWidgetHostViewGtk::CopyFromCompositingSurface( |
1038 const gfx::Rect& src_subrect, | 1038 const gfx::Rect& src_subrect, |
1039 const gfx::Size& /* dst_size */, | 1039 const gfx::Size& /* dst_size */, |
1040 const base::Callback<void(bool)>& callback, | 1040 const base::Callback<void(bool)>& callback, |
1041 skia::PlatformBitmap* output) { | 1041 skia::PlatformBitmap* output) { |
1042 base::ScopedClosureRunner scoped_callback_runner(base::Bind(callback, false)); | 1042 base::ScopedClosureRunner scoped_callback_runner(base::Bind(callback, false)); |
1043 | 1043 |
1044 const gfx::Rect bounds = GetViewBounds(); | 1044 gfx::Rect src_subrect_in_view = src_subrect; |
| 1045 src_subrect_in_view.Offset(GetViewBounds().OffsetFromOrigin()); |
| 1046 |
1045 ui::XScopedImage image(XGetImage(ui::GetXDisplay(), ui::GetX11RootWindow(), | 1047 ui::XScopedImage image(XGetImage(ui::GetXDisplay(), ui::GetX11RootWindow(), |
1046 bounds.x() + src_subrect.x(), | 1048 src_subrect_in_view.x(), |
1047 bounds.y() + src_subrect.y(), | 1049 src_subrect_in_view.y(), |
1048 src_subrect.width(), | 1050 src_subrect_in_view.width(), |
1049 src_subrect.height(), | 1051 src_subrect_in_view.height(), |
1050 AllPlanes, ZPixmap)); | 1052 AllPlanes, ZPixmap)); |
1051 if (!image.get()) | 1053 if (!image.get()) |
1052 return; | 1054 return; |
1053 | 1055 |
1054 if (!output->Allocate(src_subrect.width(), src_subrect.height(), true)) | 1056 if (!output->Allocate(src_subrect.width(), src_subrect.height(), true)) |
1055 return; | 1057 return; |
1056 | 1058 |
1057 const SkBitmap& bitmap = output->GetBitmap(); | 1059 const SkBitmap& bitmap = output->GetBitmap(); |
1058 const size_t bitmap_size = bitmap.getSize(); | 1060 const size_t bitmap_size = bitmap.getSize(); |
1059 DCHECK_EQ(bitmap_size, | 1061 DCHECK_EQ(bitmap_size, |
(...skipping 487 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1547 this)); | 1549 this)); |
1548 } | 1550 } |
1549 BrowserAccessibilityGtk* root = | 1551 BrowserAccessibilityGtk* root = |
1550 browser_accessibility_manager_->GetRoot()->ToBrowserAccessibilityGtk(); | 1552 browser_accessibility_manager_->GetRoot()->ToBrowserAccessibilityGtk(); |
1551 | 1553 |
1552 atk_object_set_role(root->GetAtkObject(), ATK_ROLE_HTML_CONTAINER); | 1554 atk_object_set_role(root->GetAtkObject(), ATK_ROLE_HTML_CONTAINER); |
1553 return root->GetAtkObject(); | 1555 return root->GetAtkObject(); |
1554 } | 1556 } |
1555 | 1557 |
1556 } // namespace content | 1558 } // namespace content |
OLD | NEW |