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 "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/location.h" | 9 #include "base/location.h" |
10 #include "base/message_loop/message_loop_proxy.h" | 10 #include "base/message_loop/message_loop_proxy.h" |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
48 #include "chrome/browser/ui/webui/signin_internals_ui.h" | 48 #include "chrome/browser/ui/webui/signin_internals_ui.h" |
49 #include "chrome/browser/ui/webui/sync_internals_ui.h" | 49 #include "chrome/browser/ui/webui/sync_internals_ui.h" |
50 #include "chrome/browser/ui/webui/translate_internals/translate_internals_ui.h" | 50 #include "chrome/browser/ui/webui/translate_internals/translate_internals_ui.h" |
51 #include "chrome/browser/ui/webui/user_actions/user_actions_ui.h" | 51 #include "chrome/browser/ui/webui/user_actions/user_actions_ui.h" |
52 #include "chrome/browser/ui/webui/version_ui.h" | 52 #include "chrome/browser/ui/webui/version_ui.h" |
53 #include "chrome/common/chrome_switches.h" | 53 #include "chrome/common/chrome_switches.h" |
54 #include "chrome/common/extensions/extension_constants.h" | 54 #include "chrome/common/extensions/extension_constants.h" |
55 #include "chrome/common/extensions/feature_switch.h" | 55 #include "chrome/common/extensions/feature_switch.h" |
56 #include "chrome/common/pref_names.h" | 56 #include "chrome/common/pref_names.h" |
57 #include "chrome/common/url_constants.h" | 57 #include "chrome/common/url_constants.h" |
| 58 #include "components/dom_distiller/core/dom_distiller_constants.h" |
| 59 #include "components/dom_distiller/webui/dom_distiller_ui.h" |
58 #include "content/public/browser/web_contents.h" | 60 #include "content/public/browser/web_contents.h" |
59 #include "content/public/browser/web_ui.h" | 61 #include "content/public/browser/web_ui.h" |
60 #include "content/public/common/content_client.h" | 62 #include "content/public/common/content_client.h" |
61 #include "content/public/common/url_utils.h" | 63 #include "content/public/common/url_utils.h" |
62 #include "extensions/common/constants.h" | 64 #include "extensions/common/constants.h" |
63 #include "ui/gfx/favicon_size.h" | 65 #include "ui/gfx/favicon_size.h" |
64 #include "ui/web_dialogs/web_dialog_ui.h" | 66 #include "ui/web_dialogs/web_dialog_ui.h" |
65 #include "url/gurl.h" | 67 #include "url/gurl.h" |
66 | 68 |
67 #if !defined(DISABLE_NACL) | 69 #if !defined(DISABLE_NACL) |
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
230 return &NewWebUI<ConstrainedWebDialogUI>; | 232 return &NewWebUI<ConstrainedWebDialogUI>; |
231 if (url.host() == chrome::kChromeUICrashesHost) | 233 if (url.host() == chrome::kChromeUICrashesHost) |
232 return &NewWebUI<CrashesUI>; | 234 return &NewWebUI<CrashesUI>; |
233 #if defined(ENABLE_MDNS) | 235 #if defined(ENABLE_MDNS) |
234 if (url.host() == chrome::kChromeUIDevicesFrameHost && | 236 if (url.host() == chrome::kChromeUIDevicesFrameHost && |
235 !CommandLine::ForCurrentProcess()->HasSwitch( | 237 !CommandLine::ForCurrentProcess()->HasSwitch( |
236 switches::kDisableDeviceDiscovery)) { | 238 switches::kDisableDeviceDiscovery)) { |
237 return &NewWebUI<LocalDiscoveryUI>; | 239 return &NewWebUI<LocalDiscoveryUI>; |
238 } | 240 } |
239 #endif | 241 #endif |
| 242 if (CommandLine::ForCurrentProcess()->HasSwitch( |
| 243 switches::kEnableDomDistiller) && |
| 244 url.host() == dom_distiller::kChromeUIDomDistillerHost) { |
| 245 return &NewWebUI<dom_distiller::DomDistillerUI>; |
| 246 } |
240 if (url.host() == chrome::kChromeUIFlagsHost) | 247 if (url.host() == chrome::kChromeUIFlagsHost) |
241 return &NewWebUI<FlagsUI>; | 248 return &NewWebUI<FlagsUI>; |
242 if (url.host() == chrome::kChromeUIHistoryFrameHost) | 249 if (url.host() == chrome::kChromeUIHistoryFrameHost) |
243 return &NewWebUI<HistoryUI>; | 250 return &NewWebUI<HistoryUI>; |
244 if (url.host() == chrome::kChromeUIInlineLoginHost) | 251 if (url.host() == chrome::kChromeUIInlineLoginHost) |
245 return &NewWebUI<InlineLoginUI>; | 252 return &NewWebUI<InlineLoginUI>; |
246 if (url.host() == chrome::kChromeUIInstantHost) | 253 if (url.host() == chrome::kChromeUIInstantHost) |
247 return &NewWebUI<InstantUI>; | 254 return &NewWebUI<InstantUI>; |
248 if (url.host() == chrome::kChromeUIManagedUserPassphrasePageHost) | 255 if (url.host() == chrome::kChromeUIManagedUserPassphrasePageHost) |
249 return &NewWebUI<ConstrainedWebDialogUI>; | 256 return &NewWebUI<ConstrainedWebDialogUI>; |
(...skipping 372 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
622 if (page_url.host() == chrome::kChromeUIPluginsHost) | 629 if (page_url.host() == chrome::kChromeUIPluginsHost) |
623 return PluginsUI::GetFaviconResourceBytes(scale_factor); | 630 return PluginsUI::GetFaviconResourceBytes(scale_factor); |
624 | 631 |
625 // Android doesn't use the components pages. | 632 // Android doesn't use the components pages. |
626 if (page_url.host() == chrome::kChromeUIComponentsHost) | 633 if (page_url.host() == chrome::kChromeUIComponentsHost) |
627 return ComponentsUI::GetFaviconResourceBytes(scale_factor); | 634 return ComponentsUI::GetFaviconResourceBytes(scale_factor); |
628 #endif | 635 #endif |
629 | 636 |
630 return NULL; | 637 return NULL; |
631 } | 638 } |
OLD | NEW |