OLD | NEW |
---|---|
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 549 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
560 #endif | 560 #endif |
561 } | 561 } |
562 // Update the size of the RWH. | 562 // Update the size of the RWH. |
563 if (requested_size_.width() != width || | 563 if (requested_size_.width() != width || |
564 requested_size_.height() != height) { | 564 requested_size_.height() != height) { |
565 requested_size_ = gfx::Size(width, height); | 565 requested_size_ = gfx::Size(width, height); |
566 host_->WasResized(); | 566 host_->WasResized(); |
567 } | 567 } |
568 } | 568 } |
569 | 569 |
570 void RenderWidgetHostViewGtk::SetMove(const gfx::Point& origin) { | |
571 // This is called when webkit has sent us a Move message. | |
572 if (IsPopup()) { | |
573 // We're a popup, honor the size request. | |
574 gtk_window_move(GTK_WINDOW(gtk_widget_get_parent(view_.get())), | |
575 origin.x(), origin.y()); | |
Ilya Sherman
2010/12/22 01:16:35
nit: This should be indented to line up with "GTK"
honten.org
2010/12/22 01:29:41
Sorry, I cannot understand what you mean.
But I un
Ilya Sherman
2010/12/22 01:39:58
This should be formatted like so:
gtk_window_move
honten.org
2010/12/22 01:41:27
Got it,
On 2010/12/22 01:39:58, Ilya Sherman wrot
| |
576 } else { | |
577 #if defined(TOOLKIT_VIEWS) | |
578 // TOOLKIT_VIEWS' resize logic flow matches windows. so we go ahead and | |
579 // size the widget. In GTK+, the size of the widget is determined by its | |
580 // children. | |
581 gtk_window_move(GTK_WINDOW(gtk_widget_get_parent(view_.get())), | |
582 origin.x(), origin.y()); | |
583 #endif | |
584 } | |
585 } | |
586 | |
570 gfx::NativeView RenderWidgetHostViewGtk::GetNativeView() { | 587 gfx::NativeView RenderWidgetHostViewGtk::GetNativeView() { |
571 return view_.get(); | 588 return view_.get(); |
572 } | 589 } |
573 | 590 |
574 void RenderWidgetHostViewGtk::MovePluginWindows( | 591 void RenderWidgetHostViewGtk::MovePluginWindows( |
575 const std::vector<webkit_glue::WebPluginGeometry>& moves) { | 592 const std::vector<webkit_glue::WebPluginGeometry>& moves) { |
576 for (size_t i = 0; i < moves.size(); ++i) { | 593 for (size_t i = 0; i < moves.size(); ++i) { |
577 plugin_container_manager_.MovePluginContainer(moves[i]); | 594 plugin_container_manager_.MovePluginContainer(moves[i]); |
578 } | 595 } |
579 } | 596 } |
(...skipping 487 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1067 } | 1084 } |
1068 | 1085 |
1069 // static | 1086 // static |
1070 RenderWidgetHostView* | 1087 RenderWidgetHostView* |
1071 RenderWidgetHostView::GetRenderWidgetHostViewFromNativeView( | 1088 RenderWidgetHostView::GetRenderWidgetHostViewFromNativeView( |
1072 gfx::NativeView widget) { | 1089 gfx::NativeView widget) { |
1073 gpointer user_data = g_object_get_data(G_OBJECT(widget), | 1090 gpointer user_data = g_object_get_data(G_OBJECT(widget), |
1074 kRenderWidgetHostViewKey); | 1091 kRenderWidgetHostViewKey); |
1075 return reinterpret_cast<RenderWidgetHostView*>(user_data); | 1092 return reinterpret_cast<RenderWidgetHostView*>(user_data); |
1076 } | 1093 } |
OLD | NEW |