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/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 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 |
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_->GetView()->GetNativeView(), |
| 214 width, height); |
| 215 } |
214 } | 216 } |
215 | 217 |
216 void Shell::PlatformResizeSubViews() { | 218 void Shell::PlatformResizeSubViews() { |
217 SizeTo(content_width_, content_height_); | 219 SizeTo(content_width_, content_height_); |
218 } | 220 } |
219 | 221 |
220 void Shell::Close() { | 222 void Shell::Close() { |
221 if (headless_) { | 223 if (headless_) { |
222 delete this; | 224 delete this; |
223 return; | 225 return; |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
289 | 291 |
290 void Shell::PlatformSetTitle(const string16& title) { | 292 void Shell::PlatformSetTitle(const string16& title) { |
291 if (headless_) | 293 if (headless_) |
292 return; | 294 return; |
293 | 295 |
294 std::string title_utf8 = UTF16ToUTF8(title); | 296 std::string title_utf8 = UTF16ToUTF8(title); |
295 gtk_window_set_title(GTK_WINDOW(window_), title_utf8.c_str()); | 297 gtk_window_set_title(GTK_WINDOW(window_), title_utf8.c_str()); |
296 } | 298 } |
297 | 299 |
298 } // namespace content | 300 } // namespace content |
OLD | NEW |