| 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/chrome_thread.h" | 8 #include "chrome/browser/chrome_thread.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/downloads_ui.h" | 10 #include "chrome/browser/dom_ui/downloads_ui.h" |
| (...skipping 12 matching lines...) Expand all Loading... |
| 23 #include "chrome/browser/extensions/extensions_ui.h" | 23 #include "chrome/browser/extensions/extensions_ui.h" |
| 24 #include "chrome/browser/printing/print_dialog_cloud.h" | 24 #include "chrome/browser/printing/print_dialog_cloud.h" |
| 25 #include "chrome/browser/profile.h" | 25 #include "chrome/browser/profile.h" |
| 26 #include "chrome/browser/tab_contents/tab_contents.h" | 26 #include "chrome/browser/tab_contents/tab_contents.h" |
| 27 #include "chrome/common/chrome_switches.h" | 27 #include "chrome/common/chrome_switches.h" |
| 28 #include "chrome/common/extensions/extension_constants.h" | 28 #include "chrome/common/extensions/extension_constants.h" |
| 29 #include "chrome/common/url_constants.h" | 29 #include "chrome/common/url_constants.h" |
| 30 #include "googleurl/src/gurl.h" | 30 #include "googleurl/src/gurl.h" |
| 31 | 31 |
| 32 #if defined(OS_CHROMEOS) | 32 #if defined(OS_CHROMEOS) |
| 33 #include "chrome/browser/chromeos/dom_ui/imageburner_ui.h" |
| 33 #include "chrome/browser/dom_ui/filebrowse_ui.h" | 34 #include "chrome/browser/dom_ui/filebrowse_ui.h" |
| 34 #include "chrome/browser/dom_ui/mediaplayer_ui.h" | 35 #include "chrome/browser/dom_ui/mediaplayer_ui.h" |
| 35 #include "chrome/browser/dom_ui/register_page_ui.h" | 36 #include "chrome/browser/dom_ui/register_page_ui.h" |
| 36 #endif | 37 #endif |
| 37 | 38 |
| 38 const DOMUITypeID DOMUIFactory::kNoDOMUI = NULL; | 39 const DOMUITypeID DOMUIFactory::kNoDOMUI = NULL; |
| 39 | 40 |
| 40 // A function for creating a new DOMUI. The caller owns the return value, which | 41 // A function for creating a new DOMUI. The caller owns the return value, which |
| 41 // may be NULL (for example, if the URL refers to an non-existent extension). | 42 // may be NULL (for example, if the URL refers to an non-existent extension). |
| 42 typedef DOMUI* (*DOMUIFactoryFunction)(TabContents* tab_contents, | 43 typedef DOMUI* (*DOMUIFactoryFunction)(TabContents* tab_contents, |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 123 return &NewDOMUI<RemotingUI>; | 124 return &NewDOMUI<RemotingUI>; |
| 124 } | 125 } |
| 125 } | 126 } |
| 126 #endif | 127 #endif |
| 127 | 128 |
| 128 #if defined(OS_CHROMEOS) | 129 #if defined(OS_CHROMEOS) |
| 129 if (url.host() == chrome::kChromeUIFileBrowseHost) | 130 if (url.host() == chrome::kChromeUIFileBrowseHost) |
| 130 return &NewDOMUI<FileBrowseUI>; | 131 return &NewDOMUI<FileBrowseUI>; |
| 131 if (url.host() == chrome::kChromeUIMediaplayerHost) | 132 if (url.host() == chrome::kChromeUIMediaplayerHost) |
| 132 return &NewDOMUI<MediaplayerUI>; | 133 return &NewDOMUI<MediaplayerUI>; |
| 134 if (url.host() == chrome::kChromeUIImageBurnerHost) |
| 135 return &NewDOMUI<ImageBurnUI>; |
| 133 if (url.host() == chrome::kChromeUIRegisterPageHost) | 136 if (url.host() == chrome::kChromeUIRegisterPageHost) |
| 134 return &NewDOMUI<RegisterPageUI>; | 137 return &NewDOMUI<RegisterPageUI>; |
| 135 if (url.host() == chrome::kChromeUISlideshowHost) | 138 if (url.host() == chrome::kChromeUISlideshowHost) |
| 136 return &NewDOMUI<SlideshowUI>; | 139 return &NewDOMUI<SlideshowUI>; |
| 137 if (url.host() == chrome::kChromeUIOptionsHost) | 140 if (url.host() == chrome::kChromeUIOptionsHost) |
| 138 return &NewDOMUI<OptionsUI>; | 141 return &NewDOMUI<OptionsUI>; |
| 139 #else | 142 #else |
| 140 if (url.host() == chrome::kChromeUIOptionsHost) { | 143 if (url.host() == chrome::kChromeUIOptionsHost) { |
| 141 if (CommandLine::ForCurrentProcess()->HasSwitch( | 144 if (CommandLine::ForCurrentProcess()->HasSwitch( |
| 142 switches::kEnableTabbedOptions)) { | 145 switches::kEnableTabbedOptions)) { |
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 229 if (page_url.host() == chrome::kChromeUIPluginsHost) | 232 if (page_url.host() == chrome::kChromeUIPluginsHost) |
| 230 return PluginsUI::GetFaviconResourceBytes(); | 233 return PluginsUI::GetFaviconResourceBytes(); |
| 231 | 234 |
| 232 #if defined(ENABLE_REMOTING) | 235 #if defined(ENABLE_REMOTING) |
| 233 if (page_url.host() == chrome::kChromeUIRemotingHost) | 236 if (page_url.host() == chrome::kChromeUIRemotingHost) |
| 234 return RemotingUI::GetFaviconResourceBytes(); | 237 return RemotingUI::GetFaviconResourceBytes(); |
| 235 #endif | 238 #endif |
| 236 | 239 |
| 237 return NULL; | 240 return NULL; |
| 238 } | 241 } |
| OLD | NEW |