| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/ui/webui/chrome_web_ui_controller_factory.h" | 5 #include "chrome/browser/ui/webui/chrome_web_ui_controller_factory.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 51 #include "chrome/browser/ui/webui/settings_utils.h" | 51 #include "chrome/browser/ui/webui/settings_utils.h" |
| 52 #include "chrome/browser/ui/webui/signin/md_user_manager_ui.h" | 52 #include "chrome/browser/ui/webui/signin/md_user_manager_ui.h" |
| 53 #include "chrome/browser/ui/webui/signin/profile_signin_confirmation_ui.h" | 53 #include "chrome/browser/ui/webui/signin/profile_signin_confirmation_ui.h" |
| 54 #include "chrome/browser/ui/webui/signin_internals_ui.h" | 54 #include "chrome/browser/ui/webui/signin_internals_ui.h" |
| 55 #include "chrome/browser/ui/webui/supervised_user_internals_ui.h" | 55 #include "chrome/browser/ui/webui/supervised_user_internals_ui.h" |
| 56 #include "chrome/browser/ui/webui/sync_internals_ui.h" | 56 #include "chrome/browser/ui/webui/sync_internals_ui.h" |
| 57 #include "chrome/browser/ui/webui/translate_internals/translate_internals_ui.h" | 57 #include "chrome/browser/ui/webui/translate_internals/translate_internals_ui.h" |
| 58 #include "chrome/browser/ui/webui/usb_internals/usb_internals_ui.h" | 58 #include "chrome/browser/ui/webui/usb_internals/usb_internals_ui.h" |
| 59 #include "chrome/browser/ui/webui/user_actions/user_actions_ui.h" | 59 #include "chrome/browser/ui/webui/user_actions/user_actions_ui.h" |
| 60 #include "chrome/browser/ui/webui/version_ui.h" | 60 #include "chrome/browser/ui/webui/version_ui.h" |
| 61 #include "chrome/browser/ui/webui/welcome_ui.h" |
| 61 #include "chrome/common/chrome_features.h" | 62 #include "chrome/common/chrome_features.h" |
| 62 #include "chrome/common/chrome_switches.h" | 63 #include "chrome/common/chrome_switches.h" |
| 63 #include "chrome/common/pref_names.h" | 64 #include "chrome/common/pref_names.h" |
| 64 #include "chrome/common/url_constants.h" | 65 #include "chrome/common/url_constants.h" |
| 65 #include "components/dom_distiller/core/dom_distiller_constants.h" | 66 #include "components/dom_distiller/core/dom_distiller_constants.h" |
| 66 #include "components/dom_distiller/core/dom_distiller_features.h" | 67 #include "components/dom_distiller/core/dom_distiller_features.h" |
| 67 #include "components/dom_distiller/core/dom_distiller_service.h" | 68 #include "components/dom_distiller/core/dom_distiller_service.h" |
| 68 #include "components/dom_distiller/core/url_constants.h" | 69 #include "components/dom_distiller/core/url_constants.h" |
| 69 #include "components/dom_distiller/webui/dom_distiller_ui.h" | 70 #include "components/dom_distiller/webui/dom_distiller_ui.h" |
| 70 #include "components/favicon/core/favicon_service.h" | 71 #include "components/favicon/core/favicon_service.h" |
| (...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 256 } | 257 } |
| 257 | 258 |
| 258 #if !defined(OS_ANDROID) | 259 #if !defined(OS_ANDROID) |
| 259 template<> | 260 template<> |
| 260 WebUIController* NewWebUI<settings::MdSettingsUI>(WebUI* web_ui, | 261 WebUIController* NewWebUI<settings::MdSettingsUI>(WebUI* web_ui, |
| 261 const GURL& url) { | 262 const GURL& url) { |
| 262 return new settings::MdSettingsUI(web_ui, url); | 263 return new settings::MdSettingsUI(web_ui, url); |
| 263 } | 264 } |
| 264 #endif | 265 #endif |
| 265 | 266 |
| 267 template <> |
| 268 WebUIController* NewWebUI<WelcomeUI>(WebUI* web_ui, const GURL& url) { |
| 269 return new WelcomeUI(web_ui, url); |
| 270 } |
| 271 |
| 266 #if defined(ENABLE_EXTENSIONS) | 272 #if defined(ENABLE_EXTENSIONS) |
| 267 // Only create ExtensionWebUI for URLs that are allowed extension bindings, | 273 // Only create ExtensionWebUI for URLs that are allowed extension bindings, |
| 268 // hosted by actual tabs. | 274 // hosted by actual tabs. |
| 269 bool NeedsExtensionWebUI(Profile* profile, const GURL& url) { | 275 bool NeedsExtensionWebUI(Profile* profile, const GURL& url) { |
| 270 if (!profile) | 276 if (!profile) |
| 271 return false; | 277 return false; |
| 272 | 278 |
| 273 const extensions::Extension* extension = | 279 const extensions::Extension* extension = |
| 274 extensions::ExtensionRegistry::Get(profile)->enabled_extensions(). | 280 extensions::ExtensionRegistry::Get(profile)->enabled_extensions(). |
| 275 GetExtensionOrAppByURL(url); | 281 GetExtensionOrAppByURL(url); |
| (...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 376 if (url.host() == chrome::kChromeUISyncResourcesHost) | 382 if (url.host() == chrome::kChromeUISyncResourcesHost) |
| 377 return &NewWebUI<WebDialogUI>; | 383 return &NewWebUI<WebDialogUI>; |
| 378 if (url.host() == chrome::kChromeUITranslateInternalsHost) | 384 if (url.host() == chrome::kChromeUITranslateInternalsHost) |
| 379 return &NewWebUI<TranslateInternalsUI>; | 385 return &NewWebUI<TranslateInternalsUI>; |
| 380 if (url.host() == chrome::kChromeUIUsbInternalsHost) | 386 if (url.host() == chrome::kChromeUIUsbInternalsHost) |
| 381 return &NewWebUI<UsbInternalsUI>; | 387 return &NewWebUI<UsbInternalsUI>; |
| 382 if (url.host() == chrome::kChromeUIUserActionsHost) | 388 if (url.host() == chrome::kChromeUIUserActionsHost) |
| 383 return &NewWebUI<UserActionsUI>; | 389 return &NewWebUI<UserActionsUI>; |
| 384 if (url.host() == chrome::kChromeUIVersionHost) | 390 if (url.host() == chrome::kChromeUIVersionHost) |
| 385 return &NewWebUI<VersionUI>; | 391 return &NewWebUI<VersionUI>; |
| 392 if (url.host() == chrome::kChromeUIWelcomeHost) |
| 393 return &NewWebUI<WelcomeUI>; |
| 386 | 394 |
| 387 /**************************************************************************** | 395 /**************************************************************************** |
| 388 * OS Specific #defines | 396 * OS Specific #defines |
| 389 ***************************************************************************/ | 397 ***************************************************************************/ |
| 390 #if !defined(OS_ANDROID) | 398 #if !defined(OS_ANDROID) |
| 391 #if !defined(OS_CHROMEOS) | 399 #if !defined(OS_CHROMEOS) |
| 392 // AppLauncherPage is not needed on Android or ChromeOS. | 400 // AppLauncherPage is not needed on Android or ChromeOS. |
| 393 if (url.host() == chrome::kChromeUIAppLauncherPageHost && | 401 if (url.host() == chrome::kChromeUIAppLauncherPageHost && |
| 394 profile && extensions::ExtensionSystem::Get(profile)-> | 402 profile && extensions::ExtensionSystem::Get(profile)-> |
| 395 extension_service()) { | 403 extension_service()) { |
| (...skipping 416 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 812 #endif | 820 #endif |
| 813 | 821 |
| 814 // Android doesn't use the plugins pages. | 822 // Android doesn't use the plugins pages. |
| 815 if (page_url.host() == chrome::kChromeUIPluginsHost) | 823 if (page_url.host() == chrome::kChromeUIPluginsHost) |
| 816 return PluginsUI::GetFaviconResourceBytes(scale_factor); | 824 return PluginsUI::GetFaviconResourceBytes(scale_factor); |
| 817 | 825 |
| 818 #endif | 826 #endif |
| 819 | 827 |
| 820 return NULL; | 828 return NULL; |
| 821 } | 829 } |
| OLD | NEW |