Disable view source for Developer Tools.
[chromium-blink-merge.git] / chrome / browser / ui / views / sad_tab_view.h
blobafb893a02949ba003647ab2d0ef75df95778871b
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
3 // found in the LICENSE file.
5 #ifndef CHROME_BROWSER_UI_VIEWS_SAD_TAB_VIEW_H_
6 #define CHROME_BROWSER_UI_VIEWS_SAD_TAB_VIEW_H_
8 #include "base/basictypes.h"
9 #include "base/compiler_specific.h"
10 #include "chrome/browser/ui/sad_tab.h"
11 #include "ui/views/controls/button/button.h"
12 #include "ui/views/controls/link_listener.h"
13 #include "ui/views/view.h"
15 namespace content {
16 class WebContents;
19 namespace views {
20 class Label;
21 class LabelButton;
24 ///////////////////////////////////////////////////////////////////////////////
26 // SadTabView
28 // 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 ///////////////////////////////////////////////////////////////////////////////
32 class SadTabView : public chrome::SadTab,
33 public views::View,
34 public views::LinkListener,
35 public views::ButtonListener {
36 public:
37 SadTabView(content::WebContents* web_contents, chrome::SadTabKind kind);
38 virtual ~SadTabView();
40 // Overridden from views::View:
41 virtual void Layout() OVERRIDE;
43 // Overridden from views::LinkListener:
44 virtual void LinkClicked(views::Link* source, int event_flags) OVERRIDE;
46 // Overridden from views::ButtonListener:
47 virtual void ButtonPressed(views::Button* source,
48 const ui::Event& event) OVERRIDE;
50 protected:
51 // Overridden from views::View:
52 virtual void OnPaint(gfx::Canvas* canvas) OVERRIDE;
54 private:
55 // Overridden from chrome::SadTab:
56 virtual void Show() OVERRIDE;
57 virtual void Close() OVERRIDE;
59 views::Label* CreateLabel(const base::string16& text);
60 views::Link* CreateLink(const base::string16& text);
62 content::WebContents* web_contents_;
63 chrome::SadTabKind kind_;
64 bool painted_;
65 views::Label* message_;
66 views::Link* help_link_;
67 views::Link* feedback_link_;
68 views::LabelButton* reload_button_;
70 DISALLOW_COPY_AND_ASSIGN(SadTabView);
73 #endif // CHROME_BROWSER_UI_VIEWS_SAD_TAB_VIEW_H__