OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/dom_ui/dom_ui_factory.h" | 5 #include "chrome/browser/dom_ui/dom_ui_factory.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "chrome/browser/about_flags.h" | 8 #include "chrome/browser/about_flags.h" |
9 #include "chrome/browser/dom_ui/bookmarks_ui.h" | 9 #include "chrome/browser/dom_ui/bookmarks_ui.h" |
10 #include "chrome/browser/dom_ui/bug_report_ui.h" | 10 #include "chrome/browser/dom_ui/bug_report_ui.h" |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
89 // when invoked for a particular tab - see NewDOMUI<ExtensionDOMUI>. | 89 // when invoked for a particular tab - see NewDOMUI<ExtensionDOMUI>. |
90 static DOMUIFactoryFunction GetDOMUIFactoryFunction(Profile* profile, | 90 static DOMUIFactoryFunction GetDOMUIFactoryFunction(Profile* profile, |
91 const GURL& url) { | 91 const GURL& url) { |
92 // Currently, any gears: URL means an HTML dialog. | 92 // Currently, any gears: URL means an HTML dialog. |
93 if (url.SchemeIs(chrome::kGearsScheme)) | 93 if (url.SchemeIs(chrome::kGearsScheme)) |
94 return &NewDOMUI<HtmlDialogUI>; | 94 return &NewDOMUI<HtmlDialogUI>; |
95 | 95 |
96 if (url.host() == chrome::kChromeUIDialogHost) | 96 if (url.host() == chrome::kChromeUIDialogHost) |
97 return &NewDOMUI<ConstrainedHtmlUI>; | 97 return &NewDOMUI<ConstrainedHtmlUI>; |
98 | 98 |
99 ExtensionService* service = profile->GetExtensionService(); | 99 ExtensionService* service = profile ? profile->GetExtensionService() : NULL; |
100 if (service && service->ExtensionBindingsAllowed(url)) | 100 if (service && service->ExtensionBindingsAllowed(url)) |
101 return &NewDOMUI<ExtensionDOMUI>; | 101 return &NewDOMUI<ExtensionDOMUI>; |
102 | 102 |
103 // All platform builds of Chrome will need to have a cloud printing | 103 // All platform builds of Chrome will need to have a cloud printing |
104 // dialog as backup. It's just that on Chrome OS, it's the only | 104 // dialog as backup. It's just that on Chrome OS, it's the only |
105 // print dialog. | 105 // print dialog. |
106 if (url.host() == chrome::kCloudPrintResourcesHost) | 106 if (url.host() == chrome::kCloudPrintResourcesHost) |
107 return &NewDOMUI<ExternalHtmlDialogUI>; | 107 return &NewDOMUI<ExternalHtmlDialogUI>; |
108 | 108 |
109 // This will get called a lot to check all URLs, so do a quick check of other | 109 // This will get called a lot to check all URLs, so do a quick check of other |
(...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
329 if (page_url.host() == chrome::kChromeUIPluginsHost) | 329 if (page_url.host() == chrome::kChromeUIPluginsHost) |
330 return PluginsUI::GetFaviconResourceBytes(); | 330 return PluginsUI::GetFaviconResourceBytes(); |
331 | 331 |
332 #if defined(ENABLE_REMOTING) | 332 #if defined(ENABLE_REMOTING) |
333 if (page_url.host() == chrome::kChromeUIRemotingHost) | 333 if (page_url.host() == chrome::kChromeUIRemotingHost) |
334 return RemotingUI::GetFaviconResourceBytes(); | 334 return RemotingUI::GetFaviconResourceBytes(); |
335 #endif | 335 #endif |
336 | 336 |
337 return NULL; | 337 return NULL; |
338 } | 338 } |
OLD | NEW |