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