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/ui/webui/chrome_web_ui_factory.h" | 5 #include "chrome/browser/ui/webui/chrome_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 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
68 #endif | 68 #endif |
69 | 69 |
70 #if defined(OS_WIN) | 70 #if defined(OS_WIN) |
71 #include "chrome/browser/ui/webui/conflicts_ui.h" | 71 #include "chrome/browser/ui/webui/conflicts_ui.h" |
72 #endif | 72 #endif |
73 | 73 |
74 #if defined(OS_POSIX) && !defined(OS_MACOSX) | 74 #if defined(OS_POSIX) && !defined(OS_MACOSX) |
75 #include "chrome/browser/ui/webui/certificate_viewer_ui.h" | 75 #include "chrome/browser/ui/webui/certificate_viewer_ui.h" |
76 #endif | 76 #endif |
77 | 77 |
| 78 #if defined(USE_AURA) |
| 79 #include "chrome/browser/ui/webui/aura/app_list_ui.h" |
| 80 #endif |
| 81 |
78 namespace { | 82 namespace { |
79 | 83 |
80 // A function for creating a new WebUI. The caller owns the return value, which | 84 // A function for creating a new WebUI. The caller owns the return value, which |
81 // may be NULL (for example, if the URL refers to an non-existent extension). | 85 // may be NULL (for example, if the URL refers to an non-existent extension). |
82 typedef ChromeWebUI* (*WebUIFactoryFunction)(TabContents* tab_contents, | 86 typedef ChromeWebUI* (*WebUIFactoryFunction)(TabContents* tab_contents, |
83 const GURL& url); | 87 const GURL& url); |
84 | 88 |
85 // Template for defining WebUIFactoryFunction. | 89 // Template for defining WebUIFactoryFunction. |
86 template<class T> | 90 template<class T> |
87 ChromeWebUI* NewWebUI(TabContents* contents, const GURL& url) { | 91 ChromeWebUI* NewWebUI(TabContents* contents, const GURL& url) { |
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
236 #endif // defined(OS_CHROMEOS) | 240 #endif // defined(OS_CHROMEOS) |
237 | 241 |
238 #if (defined(OS_LINUX) && defined(TOOLKIT_VIEWS)) || defined(USE_AURA) | 242 #if (defined(OS_LINUX) && defined(TOOLKIT_VIEWS)) || defined(USE_AURA) |
239 if (url.host() == chrome::kChromeUICollectedCookiesHost || | 243 if (url.host() == chrome::kChromeUICollectedCookiesHost || |
240 url.host() == chrome::kChromeUIHttpAuthHost || | 244 url.host() == chrome::kChromeUIHttpAuthHost || |
241 url.host() == chrome::kChromeUIRepostFormWarningHost) { | 245 url.host() == chrome::kChromeUIRepostFormWarningHost) { |
242 return &NewWebUI<ConstrainedHtmlUI>; | 246 return &NewWebUI<ConstrainedHtmlUI>; |
243 } | 247 } |
244 #endif | 248 #endif |
245 | 249 |
| 250 #if defined(USE_AURA) |
| 251 if (url.host() == chrome::kChromeUIAppListHost) |
| 252 return &NewWebUI<AppListUI>; |
| 253 #endif |
| 254 |
246 if (url.host() == chrome::kChromeUIPrintHost && | 255 if (url.host() == chrome::kChromeUIPrintHost && |
247 switches::IsPrintPreviewEnabled()) { | 256 switches::IsPrintPreviewEnabled()) { |
248 return &NewWebUI<PrintPreviewUI>; | 257 return &NewWebUI<PrintPreviewUI>; |
249 } | 258 } |
250 | 259 |
251 if (url.spec() == chrome::kChromeUIConstrainedHTMLTestURL) | 260 if (url.spec() == chrome::kChromeUIConstrainedHTMLTestURL) |
252 return &NewWebUI<ConstrainedHtmlUI>; | 261 return &NewWebUI<ConstrainedHtmlUI>; |
253 | 262 |
254 #if !defined(OS_CHROMEOS) | 263 #if !defined(OS_CHROMEOS) |
255 if (url.host() == chrome::kChromeUISyncPromoHost) { | 264 if (url.host() == chrome::kChromeUISyncPromoHost) { |
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
403 return FlashUI::GetFaviconResourceBytes(); | 412 return FlashUI::GetFaviconResourceBytes(); |
404 | 413 |
405 if (page_url.host() == chrome::kChromeUISettingsHost) | 414 if (page_url.host() == chrome::kChromeUISettingsHost) |
406 return OptionsUI::GetFaviconResourceBytes(); | 415 return OptionsUI::GetFaviconResourceBytes(); |
407 | 416 |
408 if (page_url.host() == chrome::kChromeUIPluginsHost) | 417 if (page_url.host() == chrome::kChromeUIPluginsHost) |
409 return PluginsUI::GetFaviconResourceBytes(); | 418 return PluginsUI::GetFaviconResourceBytes(); |
410 | 419 |
411 return NULL; | 420 return NULL; |
412 } | 421 } |
OLD | NEW |