| 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_proxy.h" | 10 #include "base/message_loop_proxy.h" |
| (...skipping 30 matching lines...) Expand all Loading... |
| 41 #include "chrome/browser/ui/webui/plugins_ui.h" | 41 #include "chrome/browser/ui/webui/plugins_ui.h" |
| 42 #include "chrome/browser/ui/webui/predictors/predictors_ui.h" | 42 #include "chrome/browser/ui/webui/predictors/predictors_ui.h" |
| 43 #include "chrome/browser/ui/webui/print_preview/print_preview_ui.h" | 43 #include "chrome/browser/ui/webui/print_preview/print_preview_ui.h" |
| 44 #include "chrome/browser/ui/webui/profiler_ui.h" | 44 #include "chrome/browser/ui/webui/profiler_ui.h" |
| 45 #include "chrome/browser/ui/webui/quota_internals_ui.h" | 45 #include "chrome/browser/ui/webui/quota_internals_ui.h" |
| 46 #include "chrome/browser/ui/webui/signin/profile_signin_confirmation_ui.h" | 46 #include "chrome/browser/ui/webui/signin/profile_signin_confirmation_ui.h" |
| 47 #include "chrome/browser/ui/webui/signin_internals_ui.h" | 47 #include "chrome/browser/ui/webui/signin_internals_ui.h" |
| 48 #include "chrome/browser/ui/webui/sync_internals_ui.h" | 48 #include "chrome/browser/ui/webui/sync_internals_ui.h" |
| 49 #include "chrome/browser/ui/webui/user_actions/user_actions_ui.h" | 49 #include "chrome/browser/ui/webui/user_actions/user_actions_ui.h" |
| 50 #include "chrome/browser/ui/webui/version_ui.h" | 50 #include "chrome/browser/ui/webui/version_ui.h" |
| 51 #include "chrome/browser/ui/webui/virtual_keyboard_ui.h" |
| 51 #include "chrome/common/chrome_switches.h" | 52 #include "chrome/common/chrome_switches.h" |
| 52 #include "chrome/common/extensions/extension_constants.h" | 53 #include "chrome/common/extensions/extension_constants.h" |
| 53 #include "chrome/common/extensions/feature_switch.h" | 54 #include "chrome/common/extensions/feature_switch.h" |
| 54 #include "chrome/common/pref_names.h" | 55 #include "chrome/common/pref_names.h" |
| 55 #include "chrome/common/url_constants.h" | 56 #include "chrome/common/url_constants.h" |
| 56 #include "content/public/browser/web_contents.h" | 57 #include "content/public/browser/web_contents.h" |
| 57 #include "content/public/browser/web_ui.h" | 58 #include "content/public/browser/web_ui.h" |
| 58 #include "content/public/common/content_client.h" | 59 #include "content/public/common/content_client.h" |
| 59 #include "extensions/common/constants.h" | 60 #include "extensions/common/constants.h" |
| 60 #include "googleurl/src/gurl.h" | 61 #include "googleurl/src/gurl.h" |
| (...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 178 | 179 |
| 179 // Special case the new tab page. In older versions of Chrome, the new tab | 180 // Special case the new tab page. In older versions of Chrome, the new tab |
| 180 // page was hosted at chrome-internal:<blah>. This might be in people's saved | 181 // page was hosted at chrome-internal:<blah>. This might be in people's saved |
| 181 // sessions or bookmarks, so we say any URL with that scheme triggers the new | 182 // sessions or bookmarks, so we say any URL with that scheme triggers the new |
| 182 // tab page. | 183 // tab page. |
| 183 if (url.host() == chrome::kChromeUINewTabHost || | 184 if (url.host() == chrome::kChromeUINewTabHost || |
| 184 url.SchemeIs(chrome::kChromeInternalScheme)) { | 185 url.SchemeIs(chrome::kChromeInternalScheme)) { |
| 185 return &NewWebUI<NewTabUI>; | 186 return &NewWebUI<NewTabUI>; |
| 186 } | 187 } |
| 187 | 188 |
| 189 // FIXME(bryeung): move this to the right line below |
| 190 if (url.host() == chrome::kChromeUIVirtualKeyboardHost) |
| 191 return &NewWebUI<VirtualKeyboardUI>; |
| 192 |
| 188 /**************************************************************************** | 193 /**************************************************************************** |
| 189 * Please keep this in alphabetical order. If #ifs or special logics are | 194 * Please keep this in alphabetical order. If #ifs or special logics are |
| 190 * required, add it below in the appropriate section. | 195 * required, add it below in the appropriate section. |
| 191 ***************************************************************************/ | 196 ***************************************************************************/ |
| 192 // We must compare hosts only since some of the Web UIs append extra stuff | 197 // We must compare hosts only since some of the Web UIs append extra stuff |
| 193 // after the host name. | 198 // after the host name. |
| 194 // All platform builds of Chrome will need to have a cloud printing | 199 // All platform builds of Chrome will need to have a cloud printing |
| 195 // dialog as backup. It's just that on Chrome OS, it's the only | 200 // dialog as backup. It's just that on Chrome OS, it's the only |
| 196 // print dialog. | 201 // print dialog. |
| 197 if (url.host() == chrome::kChromeUICloudPrintResourcesHost) | 202 if (url.host() == chrome::kChromeUICloudPrintResourcesHost) |
| (...skipping 372 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 570 if (page_url.host() == chrome::kChromeUISettingsFrameHost) | 575 if (page_url.host() == chrome::kChromeUISettingsFrameHost) |
| 571 return options::OptionsUI::GetFaviconResourceBytes(scale_factor); | 576 return options::OptionsUI::GetFaviconResourceBytes(scale_factor); |
| 572 | 577 |
| 573 // Android doesn't use the plugins pages. | 578 // Android doesn't use the plugins pages. |
| 574 if (page_url.host() == chrome::kChromeUIPluginsHost) | 579 if (page_url.host() == chrome::kChromeUIPluginsHost) |
| 575 return PluginsUI::GetFaviconResourceBytes(scale_factor); | 580 return PluginsUI::GetFaviconResourceBytes(scale_factor); |
| 576 #endif | 581 #endif |
| 577 | 582 |
| 578 return NULL; | 583 return NULL; |
| 579 } | 584 } |
| OLD | NEW |