| 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_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/macros.h" | 8 #include "base/macros.h" |
| 9 #include "base/memory/scoped_vector.h" | 9 #include "base/memory/scoped_vector.h" |
| 10 #include "components/favicon/content/content_favicon_driver.h" | 10 #include "components/favicon/content/content_favicon_driver.h" |
| (...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 103 // class. At any given point only one instance can be active. | 103 // class. At any given point only one instance can be active. |
| 104 static HungRendererDialogView* Create(gfx::NativeWindow context); | 104 static HungRendererDialogView* Create(gfx::NativeWindow context); |
| 105 | 105 |
| 106 // Returns a pointer to the singleton instance if any. | 106 // Returns a pointer to the singleton instance if any. |
| 107 static HungRendererDialogView* GetInstance(); | 107 static HungRendererDialogView* GetInstance(); |
| 108 | 108 |
| 109 // Shows or hides the hung renderer dialog for the given WebContents. | 109 // Shows or hides the hung renderer dialog for the given WebContents. |
| 110 static void Show(content::WebContents* contents); | 110 static void Show(content::WebContents* contents); |
| 111 static void Hide(content::WebContents* contents); | 111 static void Hide(content::WebContents* contents); |
| 112 | 112 |
| 113 // Platform specific function to kill the renderer process identified by the | |
| 114 // render process host passed in. | |
| 115 static void KillRendererProcess(content::RenderProcessHost* rph); | |
| 116 | |
| 117 // Returns true if the frame is in the foreground. | 113 // Returns true if the frame is in the foreground. |
| 118 static bool IsFrameActive(content::WebContents* contents); | 114 static bool IsFrameActive(content::WebContents* contents); |
| 119 | 115 |
| 120 virtual void ShowForWebContents(content::WebContents* contents); | 116 virtual void ShowForWebContents(content::WebContents* contents); |
| 121 virtual void EndForWebContents(content::WebContents* contents); | 117 virtual void EndForWebContents(content::WebContents* contents); |
| 122 | 118 |
| 123 // views::DialogDelegateView overrides: | 119 // views::DialogDelegateView overrides: |
| 124 base::string16 GetWindowTitle() const override; | 120 base::string16 GetWindowTitle() const override; |
| 125 void WindowClosing() override; | 121 void WindowClosing() override; |
| 126 int GetDialogButtons() const override; | 122 int GetDialogButtons() const override; |
| 127 base::string16 GetDialogButtonLabel(ui::DialogButton button) const override; | 123 base::string16 GetDialogButtonLabel(ui::DialogButton button) const override; |
| 128 views::View* CreateExtraView() override; | 124 views::View* CreateExtraView() override; |
| 129 bool Accept(bool window_closing) override; | 125 bool Cancel() override; |
| 130 bool UseNewStyleForThisDialog() const override; | 126 bool UseNewStyleForThisDialog() const override; |
| 131 | 127 |
| 132 // views::ButtonListener overrides: | 128 // views::ButtonListener overrides: |
| 133 void ButtonPressed(views::Button* sender, const ui::Event& event) override; | 129 void ButtonPressed(views::Button* sender, const ui::Event& event) override; |
| 134 | 130 |
| 135 // HungPagesTableModel::Delegate overrides: | 131 // HungPagesTableModel::Delegate overrides: |
| 136 void TabDestroyed() override; | 132 void TabDestroyed() override; |
| 137 | 133 |
| 138 protected: | 134 protected: |
| 139 HungRendererDialogView(); | 135 HungRendererDialogView(); |
| (...skipping 23 matching lines...) Expand all Loading... |
| 163 // The extra button inserted into the ClientView to kill the errant process. | 159 // The extra button inserted into the ClientView to kill the errant process. |
| 164 views::LabelButton* kill_button_; | 160 views::LabelButton* kill_button_; |
| 165 | 161 |
| 166 // The model that provides the contents of the table that shows a list of | 162 // The model that provides the contents of the table that shows a list of |
| 167 // pages affected by the hang. | 163 // pages affected by the hang. |
| 168 scoped_ptr<HungPagesTableModel> hung_pages_table_model_; | 164 scoped_ptr<HungPagesTableModel> hung_pages_table_model_; |
| 169 | 165 |
| 170 // Whether or not we've created controls for ourself. | 166 // Whether or not we've created controls for ourself. |
| 171 bool initialized_; | 167 bool initialized_; |
| 172 | 168 |
| 169 bool kill_button_clicked_; |
| 170 |
| 173 DISALLOW_COPY_AND_ASSIGN(HungRendererDialogView); | 171 DISALLOW_COPY_AND_ASSIGN(HungRendererDialogView); |
| 174 }; | 172 }; |
| 175 | 173 |
| 176 #endif // CHROME_BROWSER_UI_VIEWS_HUNG_RENDERER_VIEW_H_ | 174 #endif // CHROME_BROWSER_UI_VIEWS_HUNG_RENDERER_VIEW_H_ |
| OLD | NEW |