| 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/bug_report_ui.h" | 10 #include "chrome/browser/dom_ui/bug_report_ui.h" |
| 11 #include "chrome/browser/dom_ui/downloads_ui.h" | 11 #include "chrome/browser/dom_ui/downloads_ui.h" |
| 12 #include "chrome/browser/dom_ui/devtools_ui.h" | 12 #include "chrome/browser/dom_ui/devtools_ui.h" |
| 13 #include "chrome/browser/dom_ui/history_ui.h" | 13 #include "chrome/browser/dom_ui/history_ui.h" |
| 14 #include "chrome/browser/dom_ui/history2_ui.h" | 14 #include "chrome/browser/dom_ui/history2_ui.h" |
| 15 #include "chrome/browser/dom_ui/html_dialog_ui.h" | 15 #include "chrome/browser/dom_ui/html_dialog_ui.h" |
| 16 #if defined(TOUCH_UI) | 16 #if defined(TOUCH_UI) |
| 17 #include "chrome/browser/dom_ui/keyboard_ui.h" | 17 #include "chrome/browser/dom_ui/keyboard_ui.h" |
| 18 #endif | 18 #endif |
| 19 #include "chrome/browser/dom_ui/labs_ui.h" | 19 #include "chrome/browser/dom_ui/labs_ui.h" |
| 20 #include "chrome/browser/dom_ui/net_internals_ui.h" | 20 #include "chrome/browser/dom_ui/net_internals_ui.h" |
| 21 #include "chrome/browser/dom_ui/new_tab_ui.h" | 21 #include "chrome/browser/dom_ui/new_tab_ui.h" |
| 22 #include "chrome/browser/dom_ui/plugins_ui.h" |
| 23 #include "chrome/browser/dom_ui/print_preview_ui.h" |
| 22 #include "chrome/browser/dom_ui/remoting_ui.h" | 24 #include "chrome/browser/dom_ui/remoting_ui.h" |
| 23 #include "chrome/browser/dom_ui/plugins_ui.h" | |
| 24 #include "chrome/browser/dom_ui/options/options_ui.h" | 25 #include "chrome/browser/dom_ui/options/options_ui.h" |
| 25 #include "chrome/browser/dom_ui/slideshow_ui.h" | 26 #include "chrome/browser/dom_ui/slideshow_ui.h" |
| 26 #include "chrome/browser/extensions/extension_dom_ui.h" | 27 #include "chrome/browser/extensions/extension_dom_ui.h" |
| 27 #include "chrome/browser/extensions/extensions_service.h" | 28 #include "chrome/browser/extensions/extensions_service.h" |
| 28 #include "chrome/browser/extensions/extensions_ui.h" | 29 #include "chrome/browser/extensions/extensions_ui.h" |
| 29 #include "chrome/browser/labs.h" | 30 #include "chrome/browser/labs.h" |
| 30 #include "chrome/browser/printing/print_dialog_cloud.h" | 31 #include "chrome/browser/printing/print_dialog_cloud.h" |
| 31 #include "chrome/browser/profile.h" | 32 #include "chrome/browser/profile.h" |
| 32 #include "chrome/browser/tab_contents/tab_contents.h" | 33 #include "chrome/browser/tab_contents/tab_contents.h" |
| 33 #include "chrome/common/chrome_switches.h" | 34 #include "chrome/common/chrome_switches.h" |
| (...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 145 | 146 |
| 146 #if defined(OS_CHROMEOS) | 147 #if defined(OS_CHROMEOS) |
| 147 if (url.host() == chrome::kChromeUIFileBrowseHost) | 148 if (url.host() == chrome::kChromeUIFileBrowseHost) |
| 148 return &NewDOMUI<FileBrowseUI>; | 149 return &NewDOMUI<FileBrowseUI>; |
| 149 if (url.host() == chrome::kChromeUIImageBurnerHost) | 150 if (url.host() == chrome::kChromeUIImageBurnerHost) |
| 150 return &NewDOMUI<ImageBurnUI>; | 151 return &NewDOMUI<ImageBurnUI>; |
| 151 if (url.host() == chrome::kChromeUIMediaplayerHost) | 152 if (url.host() == chrome::kChromeUIMediaplayerHost) |
| 152 return &NewDOMUI<MediaplayerUI>; | 153 return &NewDOMUI<MediaplayerUI>; |
| 153 if (url.host() == chrome::kChromeUIMobileSetupHost) | 154 if (url.host() == chrome::kChromeUIMobileSetupHost) |
| 154 return &NewDOMUI<MobileSetupUI>; | 155 return &NewDOMUI<MobileSetupUI>; |
| 156 if (url.host() == chrome::kChromeUIPrintHost) |
| 157 return &NewDOMUI<PrintPreviewUI>; |
| 158 if (url.host() == chrome::kChromeUIRegisterPageHost) |
| 159 return &NewDOMUI<RegisterPageUI>; |
| 155 if (url.host() == chrome::kChromeUISettingsHost) | 160 if (url.host() == chrome::kChromeUISettingsHost) |
| 156 return &NewDOMUI<OptionsUI>; | 161 return &NewDOMUI<OptionsUI>; |
| 157 if (url.host() == chrome::kChromeUIRegisterPageHost) | |
| 158 return &NewDOMUI<RegisterPageUI>; | |
| 159 if (url.host() == chrome::kChromeUISlideshowHost) | 162 if (url.host() == chrome::kChromeUISlideshowHost) |
| 160 return &NewDOMUI<SlideshowUI>; | 163 return &NewDOMUI<SlideshowUI>; |
| 161 if (url.host() == chrome::kChromeUISystemInfoHost) | 164 if (url.host() == chrome::kChromeUISystemInfoHost) |
| 162 return &NewDOMUI<SystemInfoUI>; | 165 return &NewDOMUI<SystemInfoUI>; |
| 163 #else | 166 #else |
| 164 if (url.host() == chrome::kChromeUISettingsHost) { | 167 if (url.host() == chrome::kChromeUISettingsHost) { |
| 165 if (CommandLine::ForCurrentProcess()->HasSwitch( | 168 if (CommandLine::ForCurrentProcess()->HasSwitch( |
| 166 switches::kEnableTabbedOptions)) { | 169 switches::kEnableTabbedOptions)) { |
| 167 return &NewDOMUI<OptionsUI>; | 170 return &NewDOMUI<OptionsUI>; |
| 168 } | 171 } |
| 169 } | 172 } |
| 173 if (url.host() == chrome::kChromeUIPrintHost) { |
| 174 if (CommandLine::ForCurrentProcess()->HasSwitch( |
| 175 switches::kEnablePrintPreview)) { |
| 176 return &NewDOMUI<PrintPreviewUI>; |
| 177 } |
| 178 } |
| 170 #endif | 179 #endif |
| 171 | 180 |
| 172 return NULL; | 181 return NULL; |
| 173 } | 182 } |
| 174 | 183 |
| 175 // static | 184 // static |
| 176 DOMUITypeID DOMUIFactory::GetDOMUIType(Profile* profile, const GURL& url) { | 185 DOMUITypeID DOMUIFactory::GetDOMUIType(Profile* profile, const GURL& url) { |
| 177 DOMUIFactoryFunction function = GetDOMUIFactoryFunction(profile, url); | 186 DOMUIFactoryFunction function = GetDOMUIFactoryFunction(profile, url); |
| 178 return function ? reinterpret_cast<DOMUITypeID>(function) : kNoDOMUI; | 187 return function ? reinterpret_cast<DOMUITypeID>(function) : kNoDOMUI; |
| 179 } | 188 } |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 257 if (page_url.host() == chrome::kChromeUIPluginsHost) | 266 if (page_url.host() == chrome::kChromeUIPluginsHost) |
| 258 return PluginsUI::GetFaviconResourceBytes(); | 267 return PluginsUI::GetFaviconResourceBytes(); |
| 259 | 268 |
| 260 #if defined(ENABLE_REMOTING) | 269 #if defined(ENABLE_REMOTING) |
| 261 if (page_url.host() == chrome::kChromeUIRemotingHost) | 270 if (page_url.host() == chrome::kChromeUIRemotingHost) |
| 262 return RemotingUI::GetFaviconResourceBytes(); | 271 return RemotingUI::GetFaviconResourceBytes(); |
| 263 #endif | 272 #endif |
| 264 | 273 |
| 265 return NULL; | 274 return NULL; |
| 266 } | 275 } |
| OLD | NEW |