OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 "chrome/browser/tab_contents/tab_contents_view_gtk.h" | 5 #include "chrome/browser/tab_contents/tab_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 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
196 } | 196 } |
197 | 197 |
198 void TabContentsViewGtk::SetPageTitle(const std::wstring& title) { | 198 void TabContentsViewGtk::SetPageTitle(const std::wstring& title) { |
199 // Set the window name to include the page title so it's easier to spot | 199 // Set the window name to include the page title so it's easier to spot |
200 // when debugging (e.g. via xwininfo -tree). | 200 // when debugging (e.g. via xwininfo -tree). |
201 gfx::NativeView content_view = GetContentNativeView(); | 201 gfx::NativeView content_view = GetContentNativeView(); |
202 if (content_view && content_view->window) | 202 if (content_view && content_view->window) |
203 gdk_window_set_title(content_view->window, WideToUTF8(title).c_str()); | 203 gdk_window_set_title(content_view->window, WideToUTF8(title).c_str()); |
204 } | 204 } |
205 | 205 |
206 void TabContentsViewGtk::OnTabCrashed() { | 206 void TabContentsViewGtk::OnTabCrashed(base::TerminationStatus status, |
| 207 int error_code) { |
207 if (tab_contents() != NULL && !sad_tab_.get()) { | 208 if (tab_contents() != NULL && !sad_tab_.get()) { |
208 sad_tab_.reset(new SadTabGtk(tab_contents())); | 209 sad_tab_.reset(new SadTabGtk( |
| 210 tab_contents(), |
| 211 status == base::TERMINATION_STATUS_PROCESS_WAS_KILLED ? |
| 212 SadTabGtk::KILLED : SadTabGtk::CRASHED)); |
209 InsertIntoContentArea(sad_tab_->widget()); | 213 InsertIntoContentArea(sad_tab_->widget()); |
210 gtk_widget_show(sad_tab_->widget()); | 214 gtk_widget_show(sad_tab_->widget()); |
211 } | 215 } |
212 } | 216 } |
213 | 217 |
214 void TabContentsViewGtk::SizeContents(const gfx::Size& size) { | 218 void TabContentsViewGtk::SizeContents(const gfx::Size& size) { |
215 // We don't need to manually set the size of of widgets in GTK+, but we do | 219 // We don't need to manually set the size of of widgets in GTK+, but we do |
216 // need to pass the sizing information on to the RWHV which will pass the | 220 // need to pass the sizing information on to the RWHV which will pass the |
217 // sizing information on to the renderer. | 221 // sizing information on to the renderer. |
218 requested_size_ = size; | 222 requested_size_ = size; |
(...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
413 g_value_set_int(&value, child_x); | 417 g_value_set_int(&value, child_x); |
414 gtk_container_child_set_property(GTK_CONTAINER(floating_container), | 418 gtk_container_child_set_property(GTK_CONTAINER(floating_container), |
415 widget, "x", &value); | 419 widget, "x", &value); |
416 | 420 |
417 int child_y = std::max((allocation->height - requisition.height) / 2, 0); | 421 int child_y = std::max((allocation->height - requisition.height) / 2, 0); |
418 g_value_set_int(&value, child_y); | 422 g_value_set_int(&value, child_y); |
419 gtk_container_child_set_property(GTK_CONTAINER(floating_container), | 423 gtk_container_child_set_property(GTK_CONTAINER(floating_container), |
420 widget, "y", &value); | 424 widget, "y", &value); |
421 g_value_unset(&value); | 425 g_value_unset(&value); |
422 } | 426 } |
OLD | NEW |