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

Side by Side Diff: content/browser/webui/content_web_ui_controller_factory.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, 10 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « content/browser/webui/content_web_ui_controller_factory.h ('k') | content/content_browser.gypi » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Property Changes:
Added: svn:eol-style
+ LF
OLDNEW
(Empty)
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "content/browser/webui/content_web_ui_controller_factory.h"
6
7 #include "content/browser/media/webrtc_internals_ui.h"
8 #include "content/public/browser/web_contents.h"
9 #include "content/public/browser/web_ui.h"
10 #include "content/public/common/url_constants.h"
11
12 namespace content {
13
14 WebUI::TypeID ContentWebUIControllerFactory::GetWebUIType(
15 BrowserContext* browser_context, const GURL& url) const {
16 if (url.host() == chrome::kChromeUIWebRTCInternalsHost)
17 return const_cast<ContentWebUIControllerFactory*>(this);
18 return WebUI::kNoWebUI;
19 }
20
21 bool ContentWebUIControllerFactory::UseWebUIForURL(
22 BrowserContext* browser_context, const GURL& url) const {
23 return GetWebUIType(browser_context, url) != WebUI::kNoWebUI;
24 }
25
26 bool ContentWebUIControllerFactory::UseWebUIBindingsForURL(
27 BrowserContext* browser_context, const GURL& url) const {
28 return UseWebUIForURL(browser_context, url);
29 }
30
31 WebUIController* ContentWebUIControllerFactory::CreateWebUIControllerForURL(
32 WebUI* web_ui, const GURL& url) const {
33 if (url.host() == chrome::kChromeUIWebRTCInternalsHost)
34 return new WebRTCInternalsUI(web_ui);
35
36 return NULL;
37 }
38
39 // static
40 ContentWebUIControllerFactory* ContentWebUIControllerFactory::GetInstance() {
41 return Singleton<ContentWebUIControllerFactory>::get();
42 }
43
44 ContentWebUIControllerFactory::ContentWebUIControllerFactory() {
45 }
46
47 ContentWebUIControllerFactory::~ContentWebUIControllerFactory() {
48 }
49
50 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/webui/content_web_ui_controller_factory.h ('k') | content/content_browser.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698