Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(103)

Unified Diff: content/shell/shell_gtk.cc

Issue 14496004: Gtk content shell: make the window shrinkable. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 7 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/shell/shell_gtk.cc
diff --git a/content/shell/shell_gtk.cc b/content/shell/shell_gtk.cc
index 22d6b330484c30c9fdd06899f3234041727b582b..8dc187b65ef14a771c8e0587610011bb18a2ed05 100644
--- a/content/shell/shell_gtk.cc
+++ b/content/shell/shell_gtk.cc
@@ -101,16 +101,18 @@ void Shell::PlatformSetIsLoading(bool loading) {
}
void Shell::PlatformCreateWindow(int width, int height) {
+
+ if (!headless_) {
+ window_ = GTK_WINDOW(gtk_window_new(GTK_WINDOW_TOPLEVEL));
+ gtk_window_set_title(window_, "Content Shell");
+ g_signal_connect(G_OBJECT(window_), "destroy",
+ G_CALLBACK(OnWindowDestroyedThunk), this);
+ }
SizeTo(width, height);
if (headless_)
return;
- window_ = GTK_WINDOW(gtk_window_new(GTK_WINDOW_TOPLEVEL));
- gtk_window_set_title(window_, "Content Shell");
- g_signal_connect(G_OBJECT(window_), "destroy",
- G_CALLBACK(OnWindowDestroyedThunk), this);
-
vbox_ = gtk_vbox_new(FALSE, 0);
// Create the menu bar.
@@ -209,10 +211,8 @@ void Shell::PlatformSetContents() {
void Shell::SizeTo(int width, int height) {
content_width_ = width;
content_height_ = height;
- if (web_contents_) {
- gtk_widget_set_size_request(web_contents_->GetView()->GetNativeView(),
- width, height);
- }
+ if (window_)
+ gtk_window_resize(window_, width, height);
jochen (gone - plz use gerrit) 2013/05/14 07:25:33 this will break headless mode where window_ is alw
mstensho (USE GERRIT) 2013/05/14 09:28:24 So would the right thing be to keep the old code f
jochen (gone - plz use gerrit) 2013/05/14 09:31:39 Not sure. We always want the native view to be the
mstensho (USE GERRIT) 2013/05/14 09:40:16 I'm sorry, I don't understand. Can you provide me
}
void Shell::PlatformResizeSubViews() {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698