| 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 #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/utf_string_conversions.h" | 10 #include "base/utf_string_conversions.h" |
| (...skipping 15 matching lines...) Expand all Loading... |
| 26 #include "ui/base/resource/resource_bundle.h" | 26 #include "ui/base/resource/resource_bundle.h" |
| 27 #include "ui/gfx/gtk_util.h" | 27 #include "ui/gfx/gtk_util.h" |
| 28 #include "ui/gfx/image/image.h" | 28 #include "ui/gfx/image/image.h" |
| 29 | 29 |
| 30 namespace { | 30 namespace { |
| 31 | 31 |
| 32 // A wrapper class that represents the Gtk dialog. | 32 // A wrapper class that represents the Gtk dialog. |
| 33 class HungRendererDialogGtk { | 33 class HungRendererDialogGtk { |
| 34 public: | 34 public: |
| 35 HungRendererDialogGtk(); | 35 HungRendererDialogGtk(); |
| 36 virtual ~HungRendererDialogGtk() {} | 36 ~HungRendererDialogGtk() {} |
| 37 void ShowForTabContents(TabContents* hung_contents); | 37 void ShowForTabContents(TabContents* hung_contents); |
| 38 void Hide(); | 38 void Hide(); |
| 39 void EndForTabContents(TabContents* hung_contents); | 39 void EndForTabContents(TabContents* hung_contents); |
| 40 | 40 |
| 41 private: | 41 private: |
| 42 // Dismiss the panel if |contents_| is closed or its renderer exits. | 42 // Dismiss the panel if |contents_| is closed or its renderer exits. |
| 43 class TabContentsObserverImpl : public TabContentsObserver { | 43 class TabContentsObserverImpl : public TabContentsObserver { |
| 44 public: | 44 public: |
| 45 TabContentsObserverImpl(HungRendererDialogGtk* dialog, | 45 TabContentsObserverImpl(HungRendererDialogGtk* dialog, |
| 46 TabContents* contents) | 46 TabContents* contents) |
| (...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 256 g_instance->ShowForTabContents(contents); | 256 g_instance->ShowForTabContents(contents); |
| 257 } | 257 } |
| 258 } | 258 } |
| 259 | 259 |
| 260 void HideNativeHungRendererDialog(TabContents* contents) { | 260 void HideNativeHungRendererDialog(TabContents* contents) { |
| 261 if (!logging::DialogsAreSuppressed() && g_instance) | 261 if (!logging::DialogsAreSuppressed() && g_instance) |
| 262 g_instance->EndForTabContents(contents); | 262 g_instance->EndForTabContents(contents); |
| 263 } | 263 } |
| 264 | 264 |
| 265 } // namespace browser | 265 } // namespace browser |
| OLD | NEW |