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/web_contents/web_contents_view_gtk.h" | 5 #include "content/browser/web_contents/web_contents_view_gtk.h" |
6 | 6 |
7 #include <gdk/gdk.h> | 7 #include <gdk/gdk.h> |
8 #include <gdk/gdkkeysyms.h> | 8 #include <gdk/gdkkeysyms.h> |
9 #include <gtk/gtk.h> | 9 #include <gtk/gtk.h> |
10 | 10 |
(...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
246 return RenderWidgetHostViewPort::CreateViewForWidget(render_widget_host); | 246 return RenderWidgetHostViewPort::CreateViewForWidget(render_widget_host); |
247 } | 247 } |
248 | 248 |
249 void WebContentsViewGtk::SetPageTitle(const base::string16& title) { | 249 void WebContentsViewGtk::SetPageTitle(const base::string16& title) { |
250 // Set the window name to include the page title so it's easier to spot | 250 // Set the window name to include the page title so it's easier to spot |
251 // when debugging (e.g. via xwininfo -tree). | 251 // when debugging (e.g. via xwininfo -tree). |
252 gfx::NativeView content_view = GetContentNativeView(); | 252 gfx::NativeView content_view = GetContentNativeView(); |
253 if (content_view) { | 253 if (content_view) { |
254 GdkWindow* content_window = gtk_widget_get_window(content_view); | 254 GdkWindow* content_window = gtk_widget_get_window(content_view); |
255 if (content_window) { | 255 if (content_window) { |
256 gdk_window_set_title(content_window, UTF16ToUTF8(title).c_str()); | 256 gdk_window_set_title(content_window, base::UTF16ToUTF8(title).c_str()); |
257 } | 257 } |
258 } | 258 } |
259 } | 259 } |
260 | 260 |
261 void WebContentsViewGtk::SizeContents(const gfx::Size& size) { | 261 void WebContentsViewGtk::SizeContents(const gfx::Size& size) { |
262 // We don't need to manually set the size of of widgets in GTK+, but we do | 262 // We don't need to manually set the size of of widgets in GTK+, but we do |
263 // need to pass the sizing information on to the RWHV which will pass the | 263 // need to pass the sizing information on to the RWHV which will pass the |
264 // sizing information on to the renderer. | 264 // sizing information on to the renderer. |
265 requested_size_ = size; | 265 requested_size_ = size; |
266 RenderWidgetHostView* rwhv = web_contents_->GetRenderWidgetHostView(); | 266 RenderWidgetHostView* rwhv = web_contents_->GetRenderWidgetHostView(); |
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
422 // We manually tell our RWHV to resize the renderer content. This avoids | 422 // We manually tell our RWHV to resize the renderer content. This avoids |
423 // spurious resizes from GTK+. | 423 // spurious resizes from GTK+. |
424 RenderWidgetHostView* rwhv = web_contents_->GetRenderWidgetHostView(); | 424 RenderWidgetHostView* rwhv = web_contents_->GetRenderWidgetHostView(); |
425 if (rwhv) | 425 if (rwhv) |
426 rwhv->SetSize(size); | 426 rwhv->SetSize(size); |
427 if (web_contents_->GetInterstitialPage()) | 427 if (web_contents_->GetInterstitialPage()) |
428 web_contents_->GetInterstitialPage()->SetSize(size); | 428 web_contents_->GetInterstitialPage()->SetSize(size); |
429 } | 429 } |
430 | 430 |
431 } // namespace content | 431 } // namespace content |
OLD | NEW |