| 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/browser_dialogs.h" | 5 #include "chrome/browser/ui/browser_dialogs.h" |
| 6 | 6 |
| 7 #include <gtk/gtk.h> | 7 #include <gtk/gtk.h> |
| 8 | 8 |
| 9 #include "base/process_util.h" | 9 #include "base/process_util.h" |
| 10 #include "base/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 45 // Dismiss the panel if |contents_| is closed or its renderer exits. | 45 // Dismiss the panel if |contents_| is closed or its renderer exits. |
| 46 class WebContentsObserverImpl : public content::WebContentsObserver { | 46 class WebContentsObserverImpl : public content::WebContentsObserver { |
| 47 public: | 47 public: |
| 48 WebContentsObserverImpl(HungRendererDialogGtk* dialog, | 48 WebContentsObserverImpl(HungRendererDialogGtk* dialog, |
| 49 WebContents* contents) | 49 WebContents* contents) |
| 50 : content::WebContentsObserver(contents), | 50 : content::WebContentsObserver(contents), |
| 51 dialog_(dialog) { | 51 dialog_(dialog) { |
| 52 } | 52 } |
| 53 | 53 |
| 54 // content::WebContentsObserver overrides: | 54 // content::WebContentsObserver overrides: |
| 55 virtual void RenderViewGone(base::TerminationStatus status) OVERRIDE { | 55 virtual void RenderProcessGone(base::TerminationStatus status) OVERRIDE { |
| 56 dialog_->Hide(); | 56 dialog_->Hide(); |
| 57 } | 57 } |
| 58 virtual void WebContentsDestroyed(WebContents* tab) OVERRIDE { | 58 virtual void WebContentsDestroyed(WebContents* tab) OVERRIDE { |
| 59 dialog_->Hide(); | 59 dialog_->Hide(); |
| 60 } | 60 } |
| 61 | 61 |
| 62 private: | 62 private: |
| 63 HungRendererDialogGtk* dialog_; // weak | 63 HungRendererDialogGtk* dialog_; // weak |
| 64 | 64 |
| 65 DISALLOW_COPY_AND_ASSIGN(WebContentsObserverImpl); | 65 DISALLOW_COPY_AND_ASSIGN(WebContentsObserverImpl); |
| (...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 261 g_instance->ShowForWebContents(contents); | 261 g_instance->ShowForWebContents(contents); |
| 262 } | 262 } |
| 263 } | 263 } |
| 264 | 264 |
| 265 void HideHungRendererDialog(WebContents* contents) { | 265 void HideHungRendererDialog(WebContents* contents) { |
| 266 if (!logging::DialogsAreSuppressed() && g_instance) | 266 if (!logging::DialogsAreSuppressed() && g_instance) |
| 267 g_instance->EndForWebContents(contents); | 267 g_instance->EndForWebContents(contents); |
| 268 } | 268 } |
| 269 | 269 |
| 270 } // namespace chrome | 270 } // namespace chrome |
| OLD | NEW |