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

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: SizeTo 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 SizeTo(width, height);
105
104 if (headless_) 106 if (headless_)
105 return; 107 return;
106 108
107 window_ = GTK_WINDOW(gtk_window_new(GTK_WINDOW_TOPLEVEL)); 109 window_ = GTK_WINDOW(gtk_window_new(GTK_WINDOW_TOPLEVEL));
108 gtk_window_set_title(window_, "Content Shell"); 110 gtk_window_set_title(window_, "Content Shell");
109 g_signal_connect(G_OBJECT(window_), "destroy", 111 g_signal_connect(G_OBJECT(window_), "destroy",
110 G_CALLBACK(OnWindowDestroyedThunk), this); 112 G_CALLBACK(OnWindowDestroyedThunk), this);
111 113
112 vbox_ = gtk_vbox_new(FALSE, 0); 114 vbox_ = gtk_vbox_new(FALSE, 0);
113 115
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
187 gtk_container_add(GTK_CONTAINER(spinner_alignment), spinner_); 189 gtk_container_add(GTK_CONTAINER(spinner_alignment), spinner_);
188 190
189 spinner_item_ = gtk_tool_item_new(); 191 spinner_item_ = gtk_tool_item_new();
190 gtk_container_add(GTK_CONTAINER(spinner_item_), spinner_alignment); 192 gtk_container_add(GTK_CONTAINER(spinner_item_), spinner_alignment);
191 gtk_toolbar_insert(GTK_TOOLBAR(toolbar), spinner_item_, -1 /* append */); 193 gtk_toolbar_insert(GTK_TOOLBAR(toolbar), spinner_item_, -1 /* append */);
192 194
193 gtk_box_pack_start(GTK_BOX(vbox_), toolbar, FALSE, FALSE, 0); 195 gtk_box_pack_start(GTK_BOX(vbox_), toolbar, FALSE, FALSE, 0);
194 196
195 gtk_container_add(GTK_CONTAINER(window_), vbox_); 197 gtk_container_add(GTK_CONTAINER(window_), vbox_);
196 gtk_widget_show_all(GTK_WIDGET(window_)); 198 gtk_widget_show_all(GTK_WIDGET(window_));
197
198 SizeTo(width, height);
199 } 199 }
200 200
201 void Shell::PlatformSetContents() { 201 void Shell::PlatformSetContents() {
202 if (headless_) 202 if (headless_)
203 return; 203 return;
204 204
205 WebContentsView* content_view = web_contents_->GetView(); 205 WebContentsView* content_view = web_contents_->GetView();
206 gtk_container_add(GTK_CONTAINER(vbox_), content_view->GetNativeView()); 206 gtk_container_add(GTK_CONTAINER(vbox_), content_view->GetNativeView());
207 } 207 }
208 208
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
289 289
290 void Shell::PlatformSetTitle(const string16& title) { 290 void Shell::PlatformSetTitle(const string16& title) {
291 if (headless_) 291 if (headless_)
292 return; 292 return;
293 293
294 std::string title_utf8 = UTF16ToUTF8(title); 294 std::string title_utf8 = UTF16ToUTF8(title);
295 gtk_window_set_title(GTK_WINDOW(window_), title_utf8.c_str()); 295 gtk_window_set_title(GTK_WINDOW(window_), title_utf8.c_str());
296 } 296 }
297 297
298 } // namespace content 298 } // 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