| OLD | NEW |
| 1 // Copyright (c) 2011 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/webui/hung_renderer_dialog.h" | 5 #include "chrome/browser/ui/webui/hung_renderer_dialog.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| 11 #include "base/bind_helpers.h" | 11 #include "base/bind_helpers.h" |
| (...skipping 22 matching lines...) Expand all Loading... |
| 34 | 34 |
| 35 namespace { | 35 namespace { |
| 36 HungRendererDialog* g_instance = NULL; | 36 HungRendererDialog* g_instance = NULL; |
| 37 const int kHungRendererDialogWidth = 425; | 37 const int kHungRendererDialogWidth = 425; |
| 38 const int kHungRendererDialogHeight = 200; | 38 const int kHungRendererDialogHeight = 200; |
| 39 } | 39 } |
| 40 | 40 |
| 41 namespace browser { | 41 namespace browser { |
| 42 | 42 |
| 43 void ShowHungRendererDialog(WebContents* contents) { | 43 void ShowHungRendererDialog(WebContents* contents) { |
| 44 #if defined(OS_CHROMEOS) || defined(USE_AURA) | 44 // TODO(jhawkins): move this into a non-webui location. |
| 45 #if defined(USE_AURA) |
| 46 ShowNativeHungRendererDialog(contents); |
| 47 #elif defined(OS_CHROMEOS) |
| 45 HungRendererDialog::ShowHungRendererDialog(contents); | 48 HungRendererDialog::ShowHungRendererDialog(contents); |
| 46 #else | 49 #else |
| 47 // TODO(rbyers): Remove IsMoreWebUI check once we decide for sure which | 50 // TODO(rbyers): Remove IsMoreWebUI check once we decide for sure which |
| 48 // platforms will use the WebUI version of this dialog. | 51 // platforms will use the WebUI version of this dialog. |
| 49 if (chrome_web_ui::IsMoreWebUI()) | 52 if (chrome_web_ui::IsMoreWebUI()) |
| 50 HungRendererDialog::ShowHungRendererDialog(contents); | 53 HungRendererDialog::ShowHungRendererDialog(contents); |
| 51 else | 54 else |
| 52 ShowNativeHungRendererDialog(contents); | 55 ShowNativeHungRendererDialog(contents); |
| 53 #endif | 56 #endif |
| 54 } | 57 } |
| 55 | 58 |
| 56 void HideHungRendererDialog(WebContents* contents) { | 59 void HideHungRendererDialog(WebContents* contents) { |
| 57 #if defined(OS_CHROMEOS) || defined(USE_AURA) | 60 #if defined(USE_AURA) |
| 61 HideNativeHungRendererDialog(contents); |
| 62 #elif defined(OS_CHROMEOS) |
| 58 HungRendererDialog::HideHungRendererDialog(contents); | 63 HungRendererDialog::HideHungRendererDialog(contents); |
| 59 #else | 64 #else |
| 60 if (chrome_web_ui::IsMoreWebUI()) | 65 if (chrome_web_ui::IsMoreWebUI()) |
| 61 HungRendererDialog::HideHungRendererDialog(contents); | 66 HungRendererDialog::HideHungRendererDialog(contents); |
| 62 else | 67 else |
| 63 HideNativeHungRendererDialog(contents); | 68 HideNativeHungRendererDialog(contents); |
| 64 #endif | 69 #endif |
| 65 } | 70 } |
| 66 | 71 |
| 67 } // namespace browser | 72 } // namespace browser |
| (...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 238 DictionaryValue* dict = new DictionaryValue(); | 243 DictionaryValue* dict = new DictionaryValue(); |
| 239 dict->SetString("url", it->web_contents()->GetURL().spec()); | 244 dict->SetString("url", it->web_contents()->GetURL().spec()); |
| 240 dict->SetString("title", title); | 245 dict->SetString("title", title); |
| 241 tab_contents_list.Append(dict); | 246 tab_contents_list.Append(dict); |
| 242 } | 247 } |
| 243 } | 248 } |
| 244 // Send list of tab contents details to javascript. | 249 // Send list of tab contents details to javascript. |
| 245 web_ui()->CallJavascriptFunction("hungRendererDialog.setTabContentsList", | 250 web_ui()->CallJavascriptFunction("hungRendererDialog.setTabContentsList", |
| 246 tab_contents_list); | 251 tab_contents_list); |
| 247 } | 252 } |
| OLD | NEW |