Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(590)

Unified Diff: content/browser/media/webrtc_internals_ui.cc

Issue 12089034: Add a WebUIControllerFactory in content and move chrome://webrtc-internals to content. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: sync Created 7 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/browser/media/webrtc_internals_ui.h ('k') | content/browser/media/webrtc_internals_ui_observer.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/media/webrtc_internals_ui.cc
===================================================================
--- content/browser/media/webrtc_internals_ui.cc (revision 179210)
+++ content/browser/media/webrtc_internals_ui.cc (working copy)
@@ -2,22 +2,21 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "chrome/browser/ui/webui/media/webrtc_internals_ui.h"
+#include "content/browser/media/webrtc_internals_ui.h"
-#include "chrome/browser/profiles/profile.h"
-#include "chrome/browser/ui/webui/media/webrtc_internals_message_handler.h"
-#include "chrome/common/url_constants.h"
+#include "content/browser/media/webrtc_internals_message_handler.h"
+#include "content/public/browser/web_contents.h"
#include "content/public/browser/web_ui.h"
#include "content/public/browser/web_ui_data_source.h"
-#include "grit/browser_resources.h"
+#include "content/public/common/url_constants.h"
+#include "grit/content_resources.h"
-using content::WebContents;
-
+namespace content {
namespace {
-content::WebUIDataSource* CreateWebRTCInternalsHTMLSource() {
- content::WebUIDataSource* source =
- content::WebUIDataSource::Create(chrome::kChromeUIWebRTCInternalsHost);
+WebUIDataSource* CreateWebRTCInternalsHTMLSource() {
+ WebUIDataSource* source =
+ WebUIDataSource::Create(chrome::kChromeUIWebRTCInternalsHost);
source->SetJsonPath("strings.js");
source->AddResourcePath("webrtc_internals.js", IDR_WEBRTC_INTERNALS_JS);
@@ -33,10 +32,13 @@
//
////////////////////////////////////////////////////////////////////////////////
-WebRTCInternalsUI::WebRTCInternalsUI(content::WebUI* web_ui)
+WebRTCInternalsUI::WebRTCInternalsUI(WebUI* web_ui)
: WebUIController(web_ui) {
web_ui->AddMessageHandler(new WebRTCInternalsMessageHandler());
- Profile* profile = Profile::FromWebUI(web_ui);
- content::WebUIDataSource::Add(profile, CreateWebRTCInternalsHTMLSource());
+ BrowserContext* browser_context =
+ web_ui->GetWebContents()->GetBrowserContext();
+ WebUIDataSource::Add(browser_context, CreateWebRTCInternalsHTMLSource());
}
+
+} // namespace content
« no previous file with comments | « content/browser/media/webrtc_internals_ui.h ('k') | content/browser/media/webrtc_internals_ui_observer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698