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_WEBUI_HUNG_RENDERER_DIALOG_H_ | 5 #ifndef CHROME_BROWSER_UI_WEBUI_HUNG_RENDERER_DIALOG_H_ |
6 #define CHROME_BROWSER_UI_WEBUI_HUNG_RENDERER_DIALOG_H_ | 6 #define CHROME_BROWSER_UI_WEBUI_HUNG_RENDERER_DIALOG_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
11 | 11 |
12 #include "base/string16.h" | 12 #include "base/string16.h" |
13 #include "base/values.h" | 13 #include "base/values.h" |
14 #include "chrome/browser/ui/webui/html_dialog_ui.h" | 14 #include "chrome/browser/ui/webui/html_dialog_ui.h" |
15 #include "ui/gfx/native_widget_types.h" | 15 #include "ui/gfx/native_widget_types.h" |
16 | 16 |
17 class TabContents; | 17 class TabContents; |
18 | 18 |
19 class HungRendererDialog : private HtmlDialogUIDelegate { | 19 class HungRendererDialog : private HtmlDialogUIDelegate { |
20 public: | 20 public: |
21 HungRendererDialog(); | 21 HungRendererDialog(); |
22 | 22 |
23 // Shows the hung renderer dialog. | 23 // Shows the hung renderer dialog. |
24 void ShowDialog(gfx::NativeWindow owning_window, TabContents* contents); | 24 void ShowDialog(gfx::NativeWindow owning_window, TabContents* contents); |
25 | 25 |
26 // Hides the hung renderer dialog. | |
27 void HideDialog(TabContents* contents); | |
28 | |
26 private: | 29 private: |
27 // HtmlDialogUIDelegate methods | 30 // HtmlDialogUIDelegate methods |
28 virtual bool IsDialogModal() const OVERRIDE; | 31 virtual bool IsDialogModal() const OVERRIDE; |
29 virtual string16 GetDialogTitle() const OVERRIDE; | 32 virtual string16 GetDialogTitle() const OVERRIDE; |
30 virtual GURL GetDialogContentURL() const OVERRIDE; | 33 virtual GURL GetDialogContentURL() const OVERRIDE; |
31 virtual void GetWebUIMessageHandlers( | 34 virtual void GetWebUIMessageHandlers( |
32 std::vector<WebUIMessageHandler*>* handlers) const OVERRIDE; | 35 std::vector<WebUIMessageHandler*>* handlers) const OVERRIDE; |
33 virtual void GetDialogSize(gfx::Size* size) const OVERRIDE; | 36 virtual void GetDialogSize(gfx::Size* size) const OVERRIDE; |
34 virtual std::string GetDialogArgs() const OVERRIDE; | 37 virtual std::string GetDialogArgs() const OVERRIDE; |
35 virtual void OnDialogClosed(const std::string& json_retval) OVERRIDE; | 38 virtual void OnDialogClosed(const std::string& json_retval) OVERRIDE; |
36 virtual void OnCloseContents(TabContents* source, | 39 virtual void OnCloseContents(TabContents* source, |
37 bool* out_close_dialog) OVERRIDE; | 40 bool* out_close_dialog) OVERRIDE; |
38 virtual bool ShouldShowDialogTitle() const OVERRIDE; | 41 virtual bool ShouldShowDialogTitle() const OVERRIDE; |
39 | 42 |
40 // The tab contents. | 43 // The tab contents. |
41 TabContents* contents_; | 44 TabContents* contents_; |
42 | 45 |
46 // The dialog window. | |
47 gfx::NativeWindow window_; | |
48 | |
43 DISALLOW_COPY_AND_ASSIGN(HungRendererDialog); | 49 DISALLOW_COPY_AND_ASSIGN(HungRendererDialog); |
44 }; | 50 }; |
45 | 51 |
46 // Dialog handler that handles calls from the JS WebUI code to get the details | 52 // Dialog handler that handles calls from the JS WebUI code to get the details |
47 // of the list of frozen tabs. | 53 // of the list of frozen tabs. |
48 class HungRendererDialogHandler : public WebUIMessageHandler { | 54 class HungRendererDialogHandler : public WebUIMessageHandler { |
49 public: | 55 public: |
50 explicit HungRendererDialogHandler(TabContents* contents); | 56 explicit HungRendererDialogHandler(TabContents* contents); |
51 | 57 |
52 // Overridden from WebUIMessageHandler | 58 // Overridden from WebUIMessageHandler |
53 virtual void RegisterMessages(); | 59 virtual void RegisterMessages(); |
54 | 60 |
55 private: | 61 private: |
56 void RequestTabContentsList(const base::ListValue* args); | 62 void RequestTabContentsList(const base::ListValue* args); |
57 | 63 |
58 // The tab contents. | 64 // The tab contents. |
59 TabContents* contents_; | 65 TabContents* contents_; |
60 | 66 |
61 DISALLOW_COPY_AND_ASSIGN(HungRendererDialogHandler); | 67 DISALLOW_COPY_AND_ASSIGN(HungRendererDialogHandler); |
62 }; | 68 }; |
63 | 69 |
64 | 70 |
65 #endif // CHROME_BROWSER_UI_WEBUI_HUNG_RENDERER_DIALOG_H_ | 71 #endif // CHROME_BROWSER_UI_WEBUI_HUNG_RENDERER_DIALOG_H_ |
72 | |
wyck
2011/09/02 15:57:48
lint wants a newline at the the end.
| |
OLD | NEW |