1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 2 // Use of this source code is governed by a BSD-style license that can be 3 // found in the LICENSE file. 4 5 #ifndef CHROME_BROWSER_UI_GTK_SAD_TAB_GTK_H_ 6 #define CHROME_BROWSER_UI_GTK_SAD_TAB_GTK_H_ 7 #pragma once 8 9 typedef struct _GtkWidget GtkWidget; 10 11 #include "chrome/browser/ui/gtk/owned_widget_gtk.h" 12 #include "ui/base/gtk/gtk_signal.h" 13 14 class TabContents; 15 16 class SadTabGtk { 17 public: 18 enum Kind { 19 CRASHED, // The tab crashed. Display the "Aw, Snap!" page. 20 KILLED // The tab was killed. Display the killed tab page. 21 }; 22 23 explicit SadTabGtk(TabContents* tab_contents, Kind kind); 24 virtual ~SadTabGtk(); 25 26 GtkWidget* widget() const { return event_box_.get(); } 27 28 private: 29 CHROMEGTK_CALLBACK_0(SadTabGtk, void, OnLinkButtonClick); 30 31 void OnLinkButtonClick(); 32 33 TabContents* tab_contents_; 34 OwnedWidgetGtk event_box_; 35 Kind kind_; 36 37 DISALLOW_COPY_AND_ASSIGN(SadTabGtk); 38 }; 39 40 #endif // CHROME_BROWSER_UI_GTK_SAD_TAB_GTK_H_ 41