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/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" |
12 #include "base/json/json_reader.h" | 12 #include "base/json/json_reader.h" |
13 #include "base/utf_string_conversions.h" | 13 #include "base/utf_string_conversions.h" |
14 #include "base/values.h" | 14 #include "base/values.h" |
15 #include "chrome/browser/ui/browser.h" | 15 #include "chrome/browser/ui/browser.h" |
16 #include "chrome/browser/ui/browser_list.h" | 16 #include "chrome/browser/ui/browser_list.h" |
17 #include "chrome/browser/ui/browser_dialogs.h" | 17 #include "chrome/browser/ui/browser_dialogs.h" |
18 #include "chrome/browser/ui/dialog_style.h" | 18 #include "chrome/browser/ui/dialog_style.h" |
| 19 #include "chrome/browser/ui/tab_contents/core_tab_helper.h" |
19 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" | 20 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" |
20 #include "chrome/browser/ui/webui/html_dialog_ui.h" | 21 #include "chrome/browser/ui/webui/html_dialog_ui.h" |
21 #include "chrome/common/logging_chrome.h" | 22 #include "chrome/common/logging_chrome.h" |
22 #include "chrome/common/url_constants.h" | 23 #include "chrome/common/url_constants.h" |
23 #include "content/browser/renderer_host/render_view_host.h" | 24 #include "content/browser/renderer_host/render_view_host.h" |
24 #include "content/browser/tab_contents/tab_contents.h" | 25 #include "content/browser/tab_contents/tab_contents.h" |
25 #include "content/public/common/result_codes.h" | 26 #include "content/public/common/result_codes.h" |
26 #include "grit/generated_resources.h" | 27 #include "grit/generated_resources.h" |
27 #include "ui/base/l10n/l10n_util.h" | 28 #include "ui/base/l10n/l10n_util.h" |
28 | 29 |
(...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
222 } | 223 } |
223 | 224 |
224 void HungRendererDialogHandler::RequestTabContentsList( | 225 void HungRendererDialogHandler::RequestTabContentsList( |
225 const base::ListValue* args) { | 226 const base::ListValue* args) { |
226 ListValue tab_contents_list; | 227 ListValue tab_contents_list; |
227 for (TabContentsIterator it; !it.done(); ++it) { | 228 for (TabContentsIterator it; !it.done(); ++it) { |
228 if (it->tab_contents()->GetRenderProcessHost() == | 229 if (it->tab_contents()->GetRenderProcessHost() == |
229 contents_->GetRenderProcessHost()) { | 230 contents_->GetRenderProcessHost()) { |
230 string16 title = it->tab_contents()->GetTitle(); | 231 string16 title = it->tab_contents()->GetTitle(); |
231 if (title.empty()) | 232 if (title.empty()) |
232 title = TabContentsWrapper::GetDefaultTitle(); | 233 title = CoreTabHelper::GetDefaultTitle(); |
233 // Add details for |url| and |title|. | 234 // Add details for |url| and |title|. |
234 DictionaryValue* dict = new DictionaryValue(); | 235 DictionaryValue* dict = new DictionaryValue(); |
235 dict->SetString("url", it->tab_contents()->GetURL().spec()); | 236 dict->SetString("url", it->tab_contents()->GetURL().spec()); |
236 dict->SetString("title", title); | 237 dict->SetString("title", title); |
237 tab_contents_list.Append(dict); | 238 tab_contents_list.Append(dict); |
238 } | 239 } |
239 } | 240 } |
240 // Send list of tab contents details to javascript. | 241 // Send list of tab contents details to javascript. |
241 web_ui_->CallJavascriptFunction("hungRendererDialog.setTabContentsList", | 242 web_ui_->CallJavascriptFunction("hungRendererDialog.setTabContentsList", |
242 tab_contents_list); | 243 tab_contents_list); |
243 } | 244 } |
OLD | NEW |