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_HUNG_RENDERER_VIEW_WIN_H_ | 5 #ifndef CHROME_BROWSER_UI_VIEWS_HUNG_RENDERER_VIEW_WIN_H_ |
6 #define CHROME_BROWSER_UI_VIEWS_HUNG_RENDERER_VIEW_WIN_H_ | 6 #define CHROME_BROWSER_UI_VIEWS_HUNG_RENDERER_VIEW_WIN_H_ |
7 | 7 |
8 #include "chrome/browser/ui/views/hung_renderer_view.h" | 8 #include "base/basictypes.h" |
| 9 #include "chrome/browser/ui/tab_contents/tab_contents.h" |
| 10 #include "content/public/browser/web_contents.h" |
9 | 11 |
10 class HungRendererDialogViewWin : public HungRendererDialogView { | 12 // This class provides functionality to display a Windows 8 metro style hung |
| 13 // renderer dialog. |
| 14 class HungRendererDialogMetro { |
11 public: | 15 public: |
12 HungRendererDialogViewWin() {} | 16 // Creates or returns the global instance of the HungRendererDialogMetro |
13 virtual ~HungRendererDialogViewWin() {} | 17 // class |
| 18 static HungRendererDialogMetro* Create(); |
| 19 static HungRendererDialogMetro* GetInstance(); |
14 | 20 |
15 // HungRendererDialogView overrides. | 21 void Show(content::WebContents* contents); |
16 virtual void ShowForWebContents(WebContents* contents) OVERRIDE; | 22 void Hide(content::WebContents* contents); |
17 virtual void EndForWebContents(WebContents* contents) OVERRIDE; | 23 |
| 24 private: |
| 25 HungRendererDialogMetro(); |
| 26 ~HungRendererDialogMetro(); |
| 27 |
| 28 // Handlers for the hang monitor dialog displayed in Windows 8 metro. |
| 29 static void OnMetroKillProcess(); |
| 30 static void OnMetroWait(); |
| 31 |
| 32 // Resets Windows 8 metro specific state like whether the dialog was |
| 33 // displayed, etc. |
| 34 void ResetMetroState(); |
| 35 |
| 36 content::WebContents* contents_; |
| 37 |
| 38 // Set to true if the metro version of the hang dialog is displayed. |
| 39 // Helps ensure that only one instance of the dialog is displayed at any |
| 40 // given time. |
| 41 bool metro_dialog_displayed_; |
| 42 |
| 43 // Pointer to the global instance of the HungRendererDialogMetro class. |
| 44 static HungRendererDialogMetro* g_instance_; |
| 45 |
| 46 DISALLOW_COPY_AND_ASSIGN(HungRendererDialogMetro); |
18 }; | 47 }; |
19 | 48 |
20 #endif // CHROME_BROWSER_UI_VIEWS_HUNG_RENDERER_VIEW_WIN_H_ | 49 #endif // CHROME_BROWSER_UI_VIEWS_HUNG_RENDERER_VIEW_WIN_H_ |
21 | 50 |
OLD | NEW |