| 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_ui.h" | 5 #include "chrome/browser/ui/webui/hung_renderer_dialog_ui.h" |
| 6 | 6 |
| 7 #include "chrome/browser/profiles/profile.h" |
| 7 #include "chrome/browser/ui/webui/chrome_web_ui_data_source.h" | 8 #include "chrome/browser/ui/webui/chrome_web_ui_data_source.h" |
| 8 #include "chrome/browser/ui/webui/theme_source.h" | 9 #include "chrome/browser/ui/webui/theme_source.h" |
| 9 #include "chrome/common/url_constants.h" | 10 #include "chrome/common/url_constants.h" |
| 10 #include "content/browser/tab_contents/tab_contents.h" | 11 #include "content/public/browser/web_contents.h" |
| 11 #include "chrome/browser/profiles/profile.h" | |
| 12 #include "grit/browser_resources.h" | 12 #include "grit/browser_resources.h" |
| 13 #include "grit/generated_resources.h" | 13 #include "grit/generated_resources.h" |
| 14 | 14 |
| 15 HungRendererDialogUI::HungRendererDialogUI(TabContents* contents) | 15 using content::WebContents; |
| 16 |
| 17 HungRendererDialogUI::HungRendererDialogUI(WebContents* contents) |
| 16 : HtmlDialogUI(contents) { | 18 : HtmlDialogUI(contents) { |
| 17 ChromeWebUIDataSource* source = | 19 ChromeWebUIDataSource* source = |
| 18 new ChromeWebUIDataSource(chrome::kChromeUIHungRendererDialogHost); | 20 new ChromeWebUIDataSource(chrome::kChromeUIHungRendererDialogHost); |
| 19 | 21 |
| 20 source->AddLocalizedString("title", IDS_BROWSER_HANGMONITOR_RENDERER_TITLE); | 22 source->AddLocalizedString("title", IDS_BROWSER_HANGMONITOR_RENDERER_TITLE); |
| 21 source->AddLocalizedString("explanation", IDS_BROWSER_HANGMONITOR_RENDERER); | 23 source->AddLocalizedString("explanation", IDS_BROWSER_HANGMONITOR_RENDERER); |
| 22 source->AddLocalizedString("kill", IDS_BROWSER_HANGMONITOR_RENDERER_END); | 24 source->AddLocalizedString("kill", IDS_BROWSER_HANGMONITOR_RENDERER_END); |
| 23 source->AddLocalizedString("wait", IDS_BROWSER_HANGMONITOR_RENDERER_WAIT); | 25 source->AddLocalizedString("wait", IDS_BROWSER_HANGMONITOR_RENDERER_WAIT); |
| 24 | 26 |
| 25 // Set the json path. | 27 // Set the json path. |
| (...skipping 11 matching lines...) Expand all Loading... |
| 37 Profile* profile = Profile::FromBrowserContext(contents->GetBrowserContext()); | 39 Profile* profile = Profile::FromBrowserContext(contents->GetBrowserContext()); |
| 38 profile->GetChromeURLDataManager()->AddDataSource(source); | 40 profile->GetChromeURLDataManager()->AddDataSource(source); |
| 39 | 41 |
| 40 // Set up the chrome://theme/ source. | 42 // Set up the chrome://theme/ source. |
| 41 ThemeSource* theme = new ThemeSource(profile); | 43 ThemeSource* theme = new ThemeSource(profile); |
| 42 profile->GetChromeURLDataManager()->AddDataSource(theme); | 44 profile->GetChromeURLDataManager()->AddDataSource(theme); |
| 43 } | 45 } |
| 44 | 46 |
| 45 HungRendererDialogUI::~HungRendererDialogUI() { | 47 HungRendererDialogUI::~HungRendererDialogUI() { |
| 46 } | 48 } |
| OLD | NEW |