| 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/certificate_viewer_ui.h" | 5 #include "chrome/browser/ui/webui/certificate_viewer_ui.h" |
| 6 | 6 |
| 7 #include "chrome/browser/profiles/profile.h" | 7 #include "chrome/browser/profiles/profile.h" |
| 8 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" | 8 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" |
| 9 #include "chrome/browser/ui/webui/chrome_web_ui_data_source.h" | 9 #include "chrome/browser/ui/webui/chrome_web_ui_data_source.h" |
| 10 #include "chrome/common/url_constants.h" | 10 #include "chrome/common/url_constants.h" |
| 11 #include "content/browser/tab_contents/tab_contents.h" | 11 #include "content/public/browser/web_contents.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 CertificateViewerUI::CertificateViewerUI(TabContents* contents) | 15 using content::WebContents; |
| 16 |
| 17 CertificateViewerUI::CertificateViewerUI(WebContents* contents) |
| 16 #if defined(USE_AURA) | 18 #if defined(USE_AURA) |
| 17 : ConstrainedHtmlUI(contents) { | 19 : ConstrainedHtmlUI(contents) { |
| 18 #else | 20 #else |
| 19 : HtmlDialogUI(contents) { | 21 : HtmlDialogUI(contents) { |
| 20 #endif | 22 #endif |
| 21 | 23 |
| 22 // Set up the chrome://view-cert source. | 24 // Set up the chrome://view-cert source. |
| 23 ChromeWebUIDataSource* html_source = | 25 ChromeWebUIDataSource* html_source = |
| 24 new ChromeWebUIDataSource(chrome::kChromeUICertificateViewerHost); | 26 new ChromeWebUIDataSource(chrome::kChromeUICertificateViewerHost); |
| 25 | 27 |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 60 html_source->add_resource_path("certificate_viewer.css", | 62 html_source->add_resource_path("certificate_viewer.css", |
| 61 IDR_CERTIFICATE_VIEWER_CSS); | 63 IDR_CERTIFICATE_VIEWER_CSS); |
| 62 html_source->set_default_resource(IDR_CERTIFICATE_VIEWER_HTML); | 64 html_source->set_default_resource(IDR_CERTIFICATE_VIEWER_HTML); |
| 63 | 65 |
| 64 Profile* profile = Profile::FromBrowserContext(contents->GetBrowserContext()); | 66 Profile* profile = Profile::FromBrowserContext(contents->GetBrowserContext()); |
| 65 profile->GetChromeURLDataManager()->AddDataSource(html_source); | 67 profile->GetChromeURLDataManager()->AddDataSource(html_source); |
| 66 } | 68 } |
| 67 | 69 |
| 68 CertificateViewerUI::~CertificateViewerUI() { | 70 CertificateViewerUI::~CertificateViewerUI() { |
| 69 } | 71 } |
| OLD | NEW |