| OLD | NEW | 
|---|
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/webui/web_ui_factory.h" | 5 #include "chrome/browser/webui/web_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/extensions/extension_service.h" | 9 #include "chrome/browser/extensions/extension_service.h" | 
| 10 #include "chrome/browser/extensions/extension_web_ui.h" | 10 #include "chrome/browser/extensions/extension_web_ui.h" | 
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 49 #include "chrome/browser/webui/filebrowse_ui.h" | 49 #include "chrome/browser/webui/filebrowse_ui.h" | 
| 50 #include "chrome/browser/webui/mediaplayer_ui.h" | 50 #include "chrome/browser/webui/mediaplayer_ui.h" | 
| 51 #endif | 51 #endif | 
| 52 | 52 | 
| 53 #if defined(TOUCH_UI) | 53 #if defined(TOUCH_UI) | 
| 54 #include "chrome/browser/webui/keyboard_ui.h" | 54 #include "chrome/browser/webui/keyboard_ui.h" | 
| 55 #endif | 55 #endif | 
| 56 | 56 | 
| 57 #if defined(TOUCH_UI) && defined(OS_CHROMEOS) | 57 #if defined(TOUCH_UI) && defined(OS_CHROMEOS) | 
| 58 #include "chrome/browser/chromeos/webui/login/login_ui.h" | 58 #include "chrome/browser/chromeos/webui/login/login_ui.h" | 
|  | 59 #include "chrome/browser/chromeos/webui/login/login_container_ui.h" | 
| 59 #endif | 60 #endif | 
| 60 | 61 | 
| 61 #if defined(OS_WIN) | 62 #if defined(OS_WIN) | 
| 62 #include "chrome/browser/webui/conflicts_ui.h" | 63 #include "chrome/browser/webui/conflicts_ui.h" | 
| 63 #endif | 64 #endif | 
| 64 | 65 | 
| 65 const WebUITypeID WebUIFactory::kNoWebUI = NULL; | 66 const WebUITypeID WebUIFactory::kNoWebUI = NULL; | 
| 66 | 67 | 
| 67 // A function for creating a new WebUI. The caller owns the return value, which | 68 // A function for creating a new WebUI. The caller owns the return value, which | 
| 68 // may be NULL (for example, if the URL refers to an non-existent extension). | 69 // may be NULL (for example, if the URL refers to an non-existent extension). | 
| (...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 215     } | 216     } | 
| 216   } | 217   } | 
| 217   if (url.host() == chrome::kChromeUIPrintHost) { | 218   if (url.host() == chrome::kChromeUIPrintHost) { | 
| 218     if (CommandLine::ForCurrentProcess()->HasSwitch( | 219     if (CommandLine::ForCurrentProcess()->HasSwitch( | 
| 219         switches::kEnablePrintPreview)) { | 220         switches::kEnablePrintPreview)) { | 
| 220       return &NewWebUI<PrintPreviewUI>; | 221       return &NewWebUI<PrintPreviewUI>; | 
| 221     } | 222     } | 
| 222   } | 223   } | 
| 223 #endif  // defined(OS_CHROMEOS) | 224 #endif  // defined(OS_CHROMEOS) | 
| 224 | 225 | 
| 225 #if defined(TOUCH_UI) && defined(OS_CHROMEOS) | 226 #if defined(OS_CHROMEOS) && defined(TOUCH_UI) | 
| 226   if (url.host() == chrome::kChromeUILoginHost) | 227   if (url.host() == chrome::kChromeUILoginHost) | 
| 227     return &NewWebUI<chromeos::LoginUI>; | 228     return &NewWebUI<chromeos::LoginUI>; | 
|  | 229   if (url.host() == chrome::kChromeUILoginContainerHost) | 
|  | 230     return &NewWebUI<chromeos::LoginContainerUI>; | 
| 228 #endif | 231 #endif | 
| 229 | 232 | 
| 230   if (url.spec() == chrome::kChromeUIConstrainedHTMLTestURL) | 233   if (url.spec() == chrome::kChromeUIConstrainedHTMLTestURL) | 
| 231     return &NewWebUI<ConstrainedHtmlUI>; | 234     return &NewWebUI<ConstrainedHtmlUI>; | 
| 232 | 235 | 
| 233   return NULL; | 236   return NULL; | 
| 234 } | 237 } | 
| 235 | 238 | 
| 236 // static | 239 // static | 
| 237 WebUITypeID WebUIFactory::GetWebUIType(Profile* profile, const GURL& url) { | 240 WebUITypeID WebUIFactory::GetWebUIType(Profile* profile, const GURL& url) { | 
| (...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 342   if (page_url.host() == chrome::kChromeUIPluginsHost) | 345   if (page_url.host() == chrome::kChromeUIPluginsHost) | 
| 343     return PluginsUI::GetFaviconResourceBytes(); | 346     return PluginsUI::GetFaviconResourceBytes(); | 
| 344 | 347 | 
| 345 #if defined(ENABLE_REMOTING) | 348 #if defined(ENABLE_REMOTING) | 
| 346   if (page_url.host() == chrome::kChromeUIRemotingHost) | 349   if (page_url.host() == chrome::kChromeUIRemotingHost) | 
| 347     return RemotingUI::GetFaviconResourceBytes(); | 350     return RemotingUI::GetFaviconResourceBytes(); | 
| 348 #endif | 351 #endif | 
| 349 | 352 | 
| 350   return NULL; | 353   return NULL; | 
| 351 } | 354 } | 
| OLD | NEW | 
|---|