| 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 #include "chrome/browser/ui/views/hung_renderer_view.h" | 5 #include "chrome/browser/ui/views/hung_renderer_view.h" |
| 6 | 6 |
| 7 #include "base/i18n/rtl.h" | 7 #include "base/i18n/rtl.h" |
| 8 #include "base/memory/scoped_vector.h" | 8 #include "base/memory/scoped_vector.h" |
| 9 #include "base/strings/utf_string_conversions.h" | 9 #include "base/strings/utf_string_conversions.h" |
| 10 #include "chrome/browser/favicon/favicon_tab_helper.h" | 10 #include "chrome/browser/favicon/favicon_tab_helper.h" |
| 11 #include "chrome/browser/platform_util.h" | 11 #include "chrome/browser/platform_util.h" |
| 12 #include "chrome/browser/ui/browser_dialogs.h" | 12 #include "chrome/browser/ui/browser_dialogs.h" |
| 13 #include "chrome/browser/ui/browser_finder.h" | 13 #include "chrome/browser/ui/browser_finder.h" |
| 14 #include "chrome/browser/ui/chrome_web_modal_dialog_manager_delegate.h" | 14 #include "chrome/browser/ui/chrome_web_modal_dialog_manager_delegate.h" |
| 15 #include "chrome/browser/ui/tab_contents/core_tab_helper.h" | 15 #include "chrome/browser/ui/tab_contents/core_tab_helper.h" |
| 16 #include "chrome/browser/ui/tab_contents/tab_contents_iterator.h" | 16 #include "chrome/browser/ui/tab_contents/tab_contents_iterator.h" |
| 17 #include "chrome/browser/ui/views/constrained_window_views.h" | 17 #include "chrome/browser/ui/views/constrained_window_views.h" |
| 18 #include "chrome/common/chrome_constants.h" | 18 #include "chrome/common/chrome_constants.h" |
| 19 #include "chrome/common/logging_chrome.h" | 19 #include "chrome/common/logging_chrome.h" |
| 20 #include "chrome/grit/generated_resources.h" |
| 20 #include "components/web_modal/web_contents_modal_dialog_host.h" | 21 #include "components/web_modal/web_contents_modal_dialog_host.h" |
| 21 #include "content/public/browser/render_process_host.h" | 22 #include "content/public/browser/render_process_host.h" |
| 22 #include "content/public/browser/render_view_host.h" | 23 #include "content/public/browser/render_view_host.h" |
| 23 #include "content/public/browser/web_contents.h" | 24 #include "content/public/browser/web_contents.h" |
| 24 #include "content/public/common/result_codes.h" | 25 #include "content/public/common/result_codes.h" |
| 25 #include "grit/generated_resources.h" | |
| 26 #include "grit/theme_resources.h" | 26 #include "grit/theme_resources.h" |
| 27 #include "ui/aura/window.h" | 27 #include "ui/aura/window.h" |
| 28 #include "ui/base/l10n/l10n_util.h" | 28 #include "ui/base/l10n/l10n_util.h" |
| 29 #include "ui/base/resource/resource_bundle.h" | 29 #include "ui/base/resource/resource_bundle.h" |
| 30 #include "ui/gfx/canvas.h" | 30 #include "ui/gfx/canvas.h" |
| 31 #include "ui/views/controls/button/label_button.h" | 31 #include "ui/views/controls/button/label_button.h" |
| 32 #include "ui/views/controls/image_view.h" | 32 #include "ui/views/controls/image_view.h" |
| 33 #include "ui/views/controls/label.h" | 33 #include "ui/views/controls/label.h" |
| 34 #include "ui/views/layout/grid_layout.h" | 34 #include "ui/views/layout/grid_layout.h" |
| 35 #include "ui/views/layout/layout_constants.h" | 35 #include "ui/views/layout/layout_constants.h" |
| 36 #include "ui/views/widget/widget.h" | 36 #include "ui/views/widget/widget.h" |
| 37 #include "ui/views/window/client_view.h" | 37 #include "ui/views/window/client_view.h" |
| 38 | 38 |
| 39 #if defined(OS_WIN) | 39 #if defined(OS_WIN) |
| 40 #include "chrome/browser/hang_monitor/hang_crash_dump_win.h" | 40 #include "chrome/browser/hang_monitor/hang_crash_dump_win.h" |
| 41 #include "chrome/browser/profiles/profile.h" | 41 #include "chrome/browser/profiles/profile.h" |
| 42 #include "chrome/browser/shell_integration.h" | 42 #include "chrome/browser/shell_integration.h" |
| 43 #include "ui/base/win/shell.h" | 43 #include "ui/base/win/shell.h" |
| 44 #include "ui/views/win/hwnd_util.h" | 44 #include "ui/views/win/hwnd_util.h" |
| 45 #endif | 45 #endif |
| 46 | 46 |
| 47 #if defined(OS_WIN) | |
| 48 #include "ui/base/win/shell.h" | |
| 49 #endif | |
| 50 | |
| 51 using content::WebContents; | 47 using content::WebContents; |
| 52 | 48 |
| 53 HungRendererDialogView* HungRendererDialogView::g_instance_ = NULL; | 49 HungRendererDialogView* HungRendererDialogView::g_instance_ = NULL; |
| 54 | 50 |
| 55 /////////////////////////////////////////////////////////////////////////////// | 51 /////////////////////////////////////////////////////////////////////////////// |
| 56 // HungPagesTableModel, public: | 52 // HungPagesTableModel, public: |
| 57 | 53 |
| 58 HungPagesTableModel::HungPagesTableModel(Delegate* delegate) | 54 HungPagesTableModel::HungPagesTableModel(Delegate* delegate) |
| 59 : observer_(NULL), | 55 : observer_(NULL), |
| 60 delegate_(delegate) { | 56 delegate_(delegate) { |
| (...skipping 278 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 339 #endif | 335 #endif |
| 340 } | 336 } |
| 341 | 337 |
| 342 /////////////////////////////////////////////////////////////////////////////// | 338 /////////////////////////////////////////////////////////////////////////////// |
| 343 // HungRendererDialogView, views::ButtonListener implementation: | 339 // HungRendererDialogView, views::ButtonListener implementation: |
| 344 | 340 |
| 345 void HungRendererDialogView::ButtonPressed( | 341 void HungRendererDialogView::ButtonPressed( |
| 346 views::Button* sender, const ui::Event& event) { | 342 views::Button* sender, const ui::Event& event) { |
| 347 if (sender == kill_button_ && | 343 if (sender == kill_button_ && |
| 348 hung_pages_table_model_->GetRenderProcessHost()) { | 344 hung_pages_table_model_->GetRenderProcessHost()) { |
| 349 | |
| 350 base::ProcessHandle process_handle = | 345 base::ProcessHandle process_handle = |
| 351 hung_pages_table_model_->GetRenderProcessHost()->GetHandle(); | 346 hung_pages_table_model_->GetRenderProcessHost()->GetHandle(); |
| 352 | 347 |
| 353 KillRendererProcess(process_handle); | 348 KillRendererProcess(process_handle); |
| 354 } | 349 } |
| 355 } | 350 } |
| 356 | 351 |
| 357 /////////////////////////////////////////////////////////////////////////////// | 352 /////////////////////////////////////////////////////////////////////////////// |
| 358 // HungRendererDialogView, HungPagesTableModel::Delegate overrides: | 353 // HungRendererDialogView, HungPagesTableModel::Delegate overrides: |
| 359 | 354 |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 447 HungRendererDialogView* view = HungRendererDialogView::Create(toplevel_view); | 442 HungRendererDialogView* view = HungRendererDialogView::Create(toplevel_view); |
| 448 view->ShowForWebContents(contents); | 443 view->ShowForWebContents(contents); |
| 449 } | 444 } |
| 450 | 445 |
| 451 void HideHungRendererDialog(WebContents* contents) { | 446 void HideHungRendererDialog(WebContents* contents) { |
| 452 if (!logging::DialogsAreSuppressed() && HungRendererDialogView::GetInstance()) | 447 if (!logging::DialogsAreSuppressed() && HungRendererDialogView::GetInstance()) |
| 453 HungRendererDialogView::GetInstance()->EndForWebContents(contents); | 448 HungRendererDialogView::GetInstance()->EndForWebContents(contents); |
| 454 } | 449 } |
| 455 | 450 |
| 456 } // namespace chrome | 451 } // namespace chrome |
| OLD | NEW |