OLD | NEW |
(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 |
OLD | NEW |