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

Side by Side Diff: content/shell/shell_gtk.cc

Issue 11777028: GTTF: Fix problems with contents detected by debugallocation: (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fixes Created 7 years, 11 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/shell/shell.h" 5 #include "content/shell/shell.h"
6 6
7 #include <gdk/gdkkeysyms.h> 7 #include <gdk/gdkkeysyms.h>
8 #include <gtk/gtk.h> 8 #include <gtk/gtk.h>
9 9
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
94 if (headless_) 94 if (headless_)
95 return; 95 return;
96 96
97 if (loading) 97 if (loading)
98 gtk_spinner_start(GTK_SPINNER(spinner_)); 98 gtk_spinner_start(GTK_SPINNER(spinner_));
99 else 99 else
100 gtk_spinner_stop(GTK_SPINNER(spinner_)); 100 gtk_spinner_stop(GTK_SPINNER(spinner_));
101 } 101 }
102 102
103 void Shell::PlatformCreateWindow(int width, int height) { 103 void Shell::PlatformCreateWindow(int width, int height) {
104 if (headless_) 104 if (headless_)
jochen (gone - plz use gerrit) 2013/01/08 20:20:34 You should invoke SizeTo(width, height) here
105 return; 105 return;
106 106
107 window_ = GTK_WINDOW(gtk_window_new(GTK_WINDOW_TOPLEVEL)); 107 window_ = GTK_WINDOW(gtk_window_new(GTK_WINDOW_TOPLEVEL));
108 gtk_window_set_title(window_, "Content Shell"); 108 gtk_window_set_title(window_, "Content Shell");
109 g_signal_connect(G_OBJECT(window_), "destroy", 109 g_signal_connect(G_OBJECT(window_), "destroy",
110 G_CALLBACK(OnWindowDestroyedThunk), this); 110 G_CALLBACK(OnWindowDestroyedThunk), this);
111 111
112 vbox_ = gtk_vbox_new(FALSE, 0); 112 vbox_ = gtk_vbox_new(FALSE, 0);
113 113
114 // Create the menu bar. 114 // Create the menu bar.
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
207 } 207 }
208 208
209 void Shell::SizeTo(int width, int height) { 209 void Shell::SizeTo(int width, int height) {
210 content_width_ = width; 210 content_width_ = width;
211 content_height_ = height; 211 content_height_ = height;
212 if (web_contents_.get()) 212 if (web_contents_.get())
213 gtk_widget_set_size_request(web_contents_->GetNativeView(), width, height); 213 gtk_widget_set_size_request(web_contents_->GetNativeView(), width, height);
214 } 214 }
215 215
216 void Shell::PlatformResizeSubViews() { 216 void Shell::PlatformResizeSubViews() {
217 if (headless_)
218 return;
219
217 SizeTo(content_width_, content_height_); 220 SizeTo(content_width_, content_height_);
218 } 221 }
219 222
220 void Shell::Close() { 223 void Shell::Close() {
221 if (headless_) { 224 if (headless_) {
222 delete this; 225 delete this;
223 return; 226 return;
224 } 227 }
225 228
226 gtk_widget_destroy(GTK_WIDGET(window_)); 229 gtk_widget_destroy(GTK_WIDGET(window_));
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
289 292
290 void Shell::PlatformSetTitle(const string16& title) { 293 void Shell::PlatformSetTitle(const string16& title) {
291 if (headless_) 294 if (headless_)
292 return; 295 return;
293 296
294 std::string title_utf8 = UTF16ToUTF8(title); 297 std::string title_utf8 = UTF16ToUTF8(title);
295 gtk_window_set_title(GTK_WINDOW(window_), title_utf8.c_str()); 298 gtk_window_set_title(GTK_WINDOW(window_), title_utf8.c_str());
296 } 299 }
297 300
298 } // namespace content 301 } // namespace content
OLDNEW
« 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