OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 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 | 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 #ifndef CHROME_BROWSER_UI_GTK_SAD_TAB_GTK_H_ | 5 #ifndef CHROME_BROWSER_UI_GTK_SAD_TAB_GTK_H_ |
6 #define CHROME_BROWSER_UI_GTK_SAD_TAB_GTK_H_ | 6 #define CHROME_BROWSER_UI_GTK_SAD_TAB_GTK_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 typedef struct _GtkWidget GtkWidget; | 9 #include "base/basictypes.h" |
10 | 10 #include "chrome/browser/ui/sad_tab_types.h" |
11 #include "ui/base/gtk/gtk_signal.h" | 11 #include "ui/base/gtk/gtk_signal.h" |
12 #include "ui/base/gtk/owned_widget_gtk.h" | 12 #include "ui/base/gtk/owned_widget_gtk.h" |
13 | 13 |
| 14 typedef struct _GtkWidget GtkWidget; |
| 15 |
14 namespace content { | 16 namespace content { |
15 class WebContents; | 17 class WebContents; |
16 } | 18 } |
17 | 19 |
18 class SadTabGtk { | 20 class SadTabGtk { |
19 public: | 21 public: |
20 enum Kind { | 22 SadTabGtk(content::WebContents* web_contents, chrome::SadTabKind kind); |
21 CRASHED, // The tab crashed. Display the "Aw, Snap!" page. | |
22 KILLED // The tab was killed. Display the killed tab page. | |
23 }; | |
24 | |
25 SadTabGtk(content::WebContents* web_contents, Kind kind); | |
26 ~SadTabGtk(); | 23 ~SadTabGtk(); |
27 | 24 |
28 GtkWidget* widget() const { return event_box_.get(); } | 25 GtkWidget* widget() const { return event_box_.get(); } |
29 | 26 |
30 private: | 27 private: |
31 CHROMEGTK_CALLBACK_0(SadTabGtk, void, OnLinkButtonClick); | 28 CHROMEGTK_CALLBACK_0(SadTabGtk, void, OnLinkButtonClick); |
32 | 29 |
33 void OnLinkButtonClick(); | 30 void OnLinkButtonClick(); |
34 | 31 |
35 content::WebContents* web_contents_; | 32 content::WebContents* web_contents_; |
36 ui::OwnedWidgetGtk event_box_; | 33 ui::OwnedWidgetGtk event_box_; |
37 Kind kind_; | 34 chrome::SadTabKind kind_; |
38 | 35 |
39 DISALLOW_COPY_AND_ASSIGN(SadTabGtk); | 36 DISALLOW_COPY_AND_ASSIGN(SadTabGtk); |
40 }; | 37 }; |
41 | 38 |
42 #endif // CHROME_BROWSER_UI_GTK_SAD_TAB_GTK_H_ | 39 #endif // CHROME_BROWSER_UI_GTK_SAD_TAB_GTK_H_ |
OLD | NEW |