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 "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 net::URLRequestStatus::Status. | 9 // badly with net::URLRequestStatus::Status. |
10 #include "chrome/common/render_messages.h" | 10 #include "chrome/common/render_messages.h" |
(...skipping 564 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
575 #endif | 575 #endif |
576 } | 576 } |
577 // Update the size of the RWH. | 577 // Update the size of the RWH. |
578 if (requested_size_.width() != width || | 578 if (requested_size_.width() != width || |
579 requested_size_.height() != height) { | 579 requested_size_.height() != height) { |
580 requested_size_ = gfx::Size(width, height); | 580 requested_size_ = gfx::Size(width, height); |
581 host_->WasResized(); | 581 host_->WasResized(); |
582 } | 582 } |
583 } | 583 } |
584 | 584 |
| 585 void RenderWidgetHostViewGtk::MoveTo(const gfx::Point& origin) { |
| 586 // This is called when webkit has sent us a Move message. |
| 587 if (IsPopup()) { |
| 588 // We're a popup, honor the size request. |
| 589 gtk_window_move(GTK_WINDOW(gtk_widget_get_parent(view_.get())), |
| 590 origin.x(), origin.y()); |
| 591 } |
| 592 } |
| 593 |
585 gfx::NativeView RenderWidgetHostViewGtk::GetNativeView() { | 594 gfx::NativeView RenderWidgetHostViewGtk::GetNativeView() { |
586 return view_.get(); | 595 return view_.get(); |
587 } | 596 } |
588 | 597 |
589 void RenderWidgetHostViewGtk::MovePluginWindows( | 598 void RenderWidgetHostViewGtk::MovePluginWindows( |
590 const std::vector<webkit::npapi::WebPluginGeometry>& moves) { | 599 const std::vector<webkit::npapi::WebPluginGeometry>& moves) { |
591 for (size_t i = 0; i < moves.size(); ++i) { | 600 for (size_t i = 0; i < moves.size(); ++i) { |
592 plugin_container_manager_.MovePluginContainer(moves[i]); | 601 plugin_container_manager_.MovePluginContainer(moves[i]); |
593 } | 602 } |
594 } | 603 } |
(...skipping 526 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1121 } | 1130 } |
1122 | 1131 |
1123 // static | 1132 // static |
1124 RenderWidgetHostView* | 1133 RenderWidgetHostView* |
1125 RenderWidgetHostView::GetRenderWidgetHostViewFromNativeView( | 1134 RenderWidgetHostView::GetRenderWidgetHostViewFromNativeView( |
1126 gfx::NativeView widget) { | 1135 gfx::NativeView widget) { |
1127 gpointer user_data = g_object_get_data(G_OBJECT(widget), | 1136 gpointer user_data = g_object_get_data(G_OBJECT(widget), |
1128 kRenderWidgetHostViewKey); | 1137 kRenderWidgetHostViewKey); |
1129 return reinterpret_cast<RenderWidgetHostView*>(user_data); | 1138 return reinterpret_cast<RenderWidgetHostView*>(user_data); |
1130 } | 1139 } |
OLD | NEW |