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/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 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
114 virtual bool Accept(bool window_closing) OVERRIDE; | 114 virtual bool Accept(bool window_closing) OVERRIDE; |
115 virtual views::View* GetContentsView() OVERRIDE; | 115 virtual views::View* GetContentsView() OVERRIDE; |
116 | 116 |
117 // views::ButtonListener overrides: | 117 // views::ButtonListener overrides: |
118 virtual void ButtonPressed(views::Button* sender, | 118 virtual void ButtonPressed(views::Button* sender, |
119 const views::Event& event) OVERRIDE; | 119 const views::Event& event) OVERRIDE; |
120 | 120 |
121 // HungPagesTableModel::Delegate overrides: | 121 // HungPagesTableModel::Delegate overrides: |
122 virtual void TabDestroyed() OVERRIDE; | 122 virtual void TabDestroyed() OVERRIDE; |
123 | 123 |
| 124 // Helper function to kill the renderer process identified by the handle |
| 125 // passed in. |
| 126 static void KillRendererProcess(base::ProcessHandle process_handle); |
| 127 |
| 128 // Returns true if the frame is in the foreground. |
| 129 static bool IsFrameActive(WebContents* contents); |
| 130 |
124 protected: | 131 protected: |
125 HungRendererDialogView(); | 132 HungRendererDialogView(); |
126 virtual ~HungRendererDialogView(); | 133 virtual ~HungRendererDialogView(); |
127 | 134 |
128 // views::View overrides: | 135 // views::View overrides: |
129 virtual void ViewHierarchyChanged(bool is_add, | 136 virtual void ViewHierarchyChanged(bool is_add, |
130 views::View* parent, | 137 views::View* parent, |
131 views::View* child) OVERRIDE; | 138 views::View* child) OVERRIDE; |
132 | 139 |
133 // Returns true if the frame is in the foreground. | |
134 bool IsFrameActive(WebContents* contents); | |
135 | |
136 static HungRendererDialogView* g_instance_; | 140 static HungRendererDialogView* g_instance_; |
137 | 141 |
138 private: | 142 private: |
139 // Initialize the controls in this dialog. | 143 // Initialize the controls in this dialog. |
140 void Init(); | 144 void Init(); |
141 void CreateKillButtonView(); | 145 void CreateKillButtonView(); |
142 | 146 |
143 // Returns the bounds the dialog should be displayed at to be meaningfully | 147 // Returns the bounds the dialog should be displayed at to be meaningfully |
144 // associated with the specified WebContents. | 148 // associated with the specified WebContents. |
145 gfx::Rect GetDisplayBounds(WebContents* contents); | 149 gfx::Rect GetDisplayBounds(WebContents* contents); |
(...skipping 16 matching lines...) Expand all Loading... |
162 // Whether or not we've created controls for ourself. | 166 // Whether or not we've created controls for ourself. |
163 bool initialized_; | 167 bool initialized_; |
164 | 168 |
165 // An amusing icon image. | 169 // An amusing icon image. |
166 static gfx::ImageSkia* frozen_icon_; | 170 static gfx::ImageSkia* frozen_icon_; |
167 | 171 |
168 DISALLOW_COPY_AND_ASSIGN(HungRendererDialogView); | 172 DISALLOW_COPY_AND_ASSIGN(HungRendererDialogView); |
169 }; | 173 }; |
170 | 174 |
171 #endif // CHROME_BROWSER_UI_VIEWS_HUNG_RENDERER_VIEW_H_ | 175 #endif // CHROME_BROWSER_UI_VIEWS_HUNG_RENDERER_VIEW_H_ |
OLD | NEW |