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::MoveTo(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()); | |
576 } else { | |
577 #if defined(TOOLKIT_VIEWS) | |
578 // TOOLKIT_VIEWS' resize logic flow matches windows. so we go ahead and | |
Evan Stade
2011/01/22 01:32:05
are you sure this is necessary?
honten.org
2011/01/22 01:53:19
Actually I'm not sure.
I don't know how to enable
honten.org
2011/01/23 04:46:35
Evan,
I tried to make sure after turning on TOOLK
honten.org
2011/01/23 08:28:55
Evan,
I made sure we need it.
On 2011/01/23 04:4
Evan Stade
2011/01/24 23:08:02
what does this mean? If you just copied it from th
| |
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 |