Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(121)

Side by Side Diff: chrome/browser/ui/views/hung_renderer_view.h

Issue 10806079: Add support for invoking the Windows 8 metro style hung renderer dialog box. The dialog box (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | chrome/browser/ui/views/hung_renderer_view.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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_HUNG_RENDERER_VIEW_H_ 5 #ifndef CHROME_BROWSER_UI_VIEWS_HUNG_RENDERER_VIEW_H_
6 #define CHROME_BROWSER_UI_VIEWS_HUNG_RENDERER_VIEW_H_ 6 #define CHROME_BROWSER_UI_VIEWS_HUNG_RENDERER_VIEW_H_
7 7
8 #include "base/memory/scoped_vector.h" 8 #include "base/memory/scoped_vector.h"
9 #include "chrome/browser/ui/tab_contents/tab_contents.h" 9 #include "chrome/browser/ui/tab_contents/tab_contents.h"
10 #include "content/public/browser/web_contents.h" 10 #include "content/public/browser/web_contents.h"
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
92 92
93 // This class displays a dialog which contains information about a hung 93 // This class displays a dialog which contains information about a hung
94 // renderer process. 94 // renderer process.
95 class HungRendererDialogView : public views::DialogDelegateView, 95 class HungRendererDialogView : public views::DialogDelegateView,
96 public views::ButtonListener, 96 public views::ButtonListener,
97 public HungPagesTableModel::Delegate { 97 public HungPagesTableModel::Delegate {
98 public: 98 public:
99 // Factory function for creating an instance of the HungRendererDialogView 99 // Factory function for creating an instance of the HungRendererDialogView
100 // class. At any given point only one instance can be active. 100 // class. At any given point only one instance can be active.
101 static HungRendererDialogView* Create(); 101 static HungRendererDialogView* Create();
102
102 // Returns a pointer to the singleton instance if any. 103 // Returns a pointer to the singleton instance if any.
103 static HungRendererDialogView* GetInstance(); 104 static HungRendererDialogView* GetInstance();
104 105
106 // Platform specific function to kill the renderer process identified by the
107 // handle passed in.
108 static void KillRendererProcess(base::ProcessHandle process_handle);
109
110 // Returns true if the frame is in the foreground.
111 static bool IsFrameActive(WebContents* contents);
112
105 virtual void ShowForWebContents(WebContents* contents); 113 virtual void ShowForWebContents(WebContents* contents);
106 virtual void EndForWebContents(WebContents* contents); 114 virtual void EndForWebContents(WebContents* contents);
107 115
108 // views::DialogDelegateView overrides: 116 // views::DialogDelegateView overrides:
109 virtual string16 GetWindowTitle() const OVERRIDE; 117 virtual string16 GetWindowTitle() const OVERRIDE;
110 virtual void WindowClosing() OVERRIDE; 118 virtual void WindowClosing() OVERRIDE;
111 virtual int GetDialogButtons() const OVERRIDE; 119 virtual int GetDialogButtons() const OVERRIDE;
112 virtual string16 GetDialogButtonLabel(ui::DialogButton button) const OVERRIDE; 120 virtual string16 GetDialogButtonLabel(ui::DialogButton button) const OVERRIDE;
113 virtual views::View* GetExtraView() OVERRIDE; 121 virtual views::View* GetExtraView() OVERRIDE;
114 virtual bool Accept(bool window_closing) OVERRIDE; 122 virtual bool Accept(bool window_closing) OVERRIDE;
115 virtual views::View* GetContentsView() OVERRIDE; 123 virtual views::View* GetContentsView() OVERRIDE;
116 124
117 // views::ButtonListener overrides: 125 // views::ButtonListener overrides:
118 virtual void ButtonPressed(views::Button* sender, 126 virtual void ButtonPressed(views::Button* sender,
119 const views::Event& event) OVERRIDE; 127 const views::Event& event) OVERRIDE;
120 128
121 // HungPagesTableModel::Delegate overrides: 129 // HungPagesTableModel::Delegate overrides:
122 virtual void TabDestroyed() OVERRIDE; 130 virtual void TabDestroyed() OVERRIDE;
123 131
124 protected: 132 protected:
125 HungRendererDialogView(); 133 HungRendererDialogView();
126 virtual ~HungRendererDialogView(); 134 virtual ~HungRendererDialogView();
127 135
128 // views::View overrides: 136 // views::View overrides:
129 virtual void ViewHierarchyChanged(bool is_add, 137 virtual void ViewHierarchyChanged(bool is_add,
130 views::View* parent, 138 views::View* parent,
131 views::View* child) OVERRIDE; 139 views::View* child) OVERRIDE;
132 140
133 // Returns true if the frame is in the foreground.
134 bool IsFrameActive(WebContents* contents);
135
136 static HungRendererDialogView* g_instance_; 141 static HungRendererDialogView* g_instance_;
137 142
138 private: 143 private:
139 // Initialize the controls in this dialog. 144 // Initialize the controls in this dialog.
140 void Init(); 145 void Init();
141 void CreateKillButtonView(); 146 void CreateKillButtonView();
142 147
143 // Returns the bounds the dialog should be displayed at to be meaningfully 148 // Returns the bounds the dialog should be displayed at to be meaningfully
144 // associated with the specified WebContents. 149 // associated with the specified WebContents.
145 gfx::Rect GetDisplayBounds(WebContents* contents); 150 gfx::Rect GetDisplayBounds(WebContents* contents);
(...skipping 16 matching lines...) Expand all
162 // Whether or not we've created controls for ourself. 167 // Whether or not we've created controls for ourself.
163 bool initialized_; 168 bool initialized_;
164 169
165 // An amusing icon image. 170 // An amusing icon image.
166 static gfx::ImageSkia* frozen_icon_; 171 static gfx::ImageSkia* frozen_icon_;
167 172
168 DISALLOW_COPY_AND_ASSIGN(HungRendererDialogView); 173 DISALLOW_COPY_AND_ASSIGN(HungRendererDialogView);
169 }; 174 };
170 175
171 #endif // CHROME_BROWSER_UI_VIEWS_HUNG_RENDERER_VIEW_H_ 176 #endif // CHROME_BROWSER_UI_VIEWS_HUNG_RENDERER_VIEW_H_
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/ui/views/hung_renderer_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698