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 #ifndef CHROME_BROWSER_UI_VIEWS_SAD_TAB_VIEW_H_ | 5 #ifndef COMPONENTS_SAD_TAB_VIEWS_SAD_TAB_VIEW_H_ |
6 #define CHROME_BROWSER_UI_VIEWS_SAD_TAB_VIEW_H_ | 6 #define COMPONENTS_SAD_TAB_VIEWS_SAD_TAB_VIEW_H_ |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
10 #include "chrome/browser/ui/sad_tab.h" | 10 #include "components/sad_tab/sad_tab.h" |
11 #include "ui/views/controls/button/button.h" | 11 #include "ui/views/controls/button/button.h" |
12 #include "ui/views/controls/link_listener.h" | 12 #include "ui/views/controls/link_listener.h" |
13 #include "ui/views/view.h" | 13 #include "ui/views/view.h" |
14 | 14 |
15 namespace content { | 15 namespace content { |
16 class WebContents; | 16 class WebContents; |
17 } | 17 } |
18 | 18 |
19 namespace views { | 19 namespace views { |
20 class Label; | 20 class Label; |
21 class LabelButton; | 21 class LabelButton; |
22 } | 22 } |
23 | 23 |
| 24 namespace sad_tab { |
| 25 |
24 /////////////////////////////////////////////////////////////////////////////// | 26 /////////////////////////////////////////////////////////////////////////////// |
25 // | 27 // |
26 // SadTabView | 28 // SadTabView |
27 // | 29 // |
28 // A views::View subclass used to render the presentation of the crashed | 30 // A views::View subclass used to render the presentation of the crashed |
29 // "sad tab" in the browser window when a renderer is destroyed unnaturally. | 31 // "sad tab" in the browser window when a renderer is destroyed unnaturally. |
30 // | 32 // |
31 /////////////////////////////////////////////////////////////////////////////// | 33 /////////////////////////////////////////////////////////////////////////////// |
32 class SadTabView : public chrome::SadTab, | 34 class SadTabView : public SadTab, |
33 public views::View, | 35 public views::View, |
34 public views::LinkListener, | 36 public views::LinkListener, |
35 public views::ButtonListener { | 37 public views::ButtonListener { |
36 public: | 38 public: |
37 SadTabView(content::WebContents* web_contents, chrome::SadTabKind kind); | 39 SadTabView(content::WebContents* web_contents, |
| 40 SadTabKind kind, |
| 41 SadTabClient* client); |
38 virtual ~SadTabView(); | 42 virtual ~SadTabView(); |
39 | 43 |
40 // Overridden from views::View: | 44 // Overridden from views::View: |
41 virtual void Layout() OVERRIDE; | 45 virtual void Layout() OVERRIDE; |
42 | 46 |
43 // Overridden from views::LinkListener: | 47 // Overridden from views::LinkListener: |
44 virtual void LinkClicked(views::Link* source, int event_flags) OVERRIDE; | 48 virtual void LinkClicked(views::Link* source, int event_flags) OVERRIDE; |
45 | 49 |
46 // Overridden from views::ButtonListener: | 50 // Overridden from views::ButtonListener: |
47 virtual void ButtonPressed(views::Button* source, | 51 virtual void ButtonPressed(views::Button* source, |
48 const ui::Event& event) OVERRIDE; | 52 const ui::Event& event) OVERRIDE; |
49 | 53 |
50 protected: | 54 protected: |
51 // Overridden from views::View: | 55 // Overridden from views::View: |
52 virtual void OnPaint(gfx::Canvas* canvas) OVERRIDE; | 56 virtual void OnPaint(gfx::Canvas* canvas) OVERRIDE; |
53 | 57 |
54 private: | 58 private: |
55 // Overridden from chrome::SadTab: | 59 // Overridden from SadTab: |
56 virtual void Show() OVERRIDE; | 60 virtual void Show() OVERRIDE; |
57 virtual void Close() OVERRIDE; | 61 virtual void Close() OVERRIDE; |
58 | 62 |
59 views::Label* CreateLabel(const base::string16& text); | 63 views::Label* CreateLabel(const base::string16& text); |
60 views::Link* CreateLink(const base::string16& text); | 64 views::Link* CreateLink(const base::string16& text); |
61 | 65 |
62 content::WebContents* web_contents_; | 66 content::WebContents* web_contents_; |
63 chrome::SadTabKind kind_; | 67 SadTabKind kind_; |
| 68 SadTabClient* client_; |
64 bool painted_; | 69 bool painted_; |
65 views::Label* message_; | 70 views::Label* message_; |
66 views::Link* help_link_; | 71 views::Link* help_link_; |
67 views::Link* feedback_link_; | 72 views::Link* feedback_link_; |
68 views::LabelButton* reload_button_; | 73 views::LabelButton* reload_button_; |
69 | 74 |
70 DISALLOW_COPY_AND_ASSIGN(SadTabView); | 75 DISALLOW_COPY_AND_ASSIGN(SadTabView); |
71 }; | 76 }; |
72 | 77 |
73 #endif // CHROME_BROWSER_UI_VIEWS_SAD_TAB_VIEW_H__ | 78 } // namespace sad_tab |
| 79 |
| 80 #endif // COMPONENTS_SAD_TAB_VIEWS_SAD_TAB_VIEW_H__ |
OLD | NEW |