| 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 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 61 #endif | 61 #endif |
| 62 | 62 |
| 63 #if defined(TOUCH_UI) | 63 #if defined(TOUCH_UI) |
| 64 #include "chrome/browser/ui/webui/keyboard_ui.h" | 64 #include "chrome/browser/ui/webui/keyboard_ui.h" |
| 65 #endif | 65 #endif |
| 66 | 66 |
| 67 #if defined(OS_WIN) | 67 #if defined(OS_WIN) |
| 68 #include "chrome/browser/ui/webui/conflicts_ui.h" | 68 #include "chrome/browser/ui/webui/conflicts_ui.h" |
| 69 #endif | 69 #endif |
| 70 | 70 |
| 71 #if defined(WEBUI_CERTIFICATE_VIEWER) | 71 #if defined(WEBUI_DIALOGS) && defined(OS_POSIX) && !defined(OS_MACOSX) |
| 72 #include "chrome/browser/ui/webui/certificate_viewer_ui.h" | 72 #include "chrome/browser/ui/webui/certificate_viewer_ui.h" |
| 73 #endif | 73 #endif |
| 74 | 74 |
| 75 namespace { | 75 namespace { |
| 76 | 76 |
| 77 // A function for creating a new WebUI. The caller owns the return value, which | 77 // A function for creating a new WebUI. The caller owns the return value, which |
| 78 // may be NULL (for example, if the URL refers to an non-existent extension). | 78 // may be NULL (for example, if the URL refers to an non-existent extension). |
| 79 typedef ChromeWebUI* (*WebUIFactoryFunction)(TabContents* tab_contents, | 79 typedef ChromeWebUI* (*WebUIFactoryFunction)(TabContents* tab_contents, |
| 80 const GURL& url); | 80 const GURL& url); |
| 81 | 81 |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 139 if (url.host() == chrome::kChromeUIAboutHost || | 139 if (url.host() == chrome::kChromeUIAboutHost || |
| 140 url.host() == chrome::kChromeUIChromeURLsHost) | 140 url.host() == chrome::kChromeUIChromeURLsHost) |
| 141 return &NewWebUI<ChromeWebUI>; | 141 return &NewWebUI<ChromeWebUI>; |
| 142 | 142 |
| 143 // We must compare hosts only since some of the Web UIs append extra stuff | 143 // We must compare hosts only since some of the Web UIs append extra stuff |
| 144 // after the host name. | 144 // after the host name. |
| 145 if (url.host() == chrome::kChromeUIBookmarksHost) | 145 if (url.host() == chrome::kChromeUIBookmarksHost) |
| 146 return &NewWebUI<BookmarksUI>; | 146 return &NewWebUI<BookmarksUI>; |
| 147 if (url.host() == chrome::kChromeUIBugReportHost) | 147 if (url.host() == chrome::kChromeUIBugReportHost) |
| 148 return &NewWebUI<BugReportUI>; | 148 return &NewWebUI<BugReportUI>; |
| 149 #if defined(WEBUI_CERTIFICATE_VIEWER) | 149 #if defined(WEBUI_DIALOGS) && defined(OS_POSIX) && !defined(OS_MACOSX) |
| 150 if (url.host() == chrome::kChromeUICertificateViewerHost) | 150 if (url.host() == chrome::kChromeUICertificateViewerHost) |
| 151 return &NewWebUI<CertificateViewerUI>; | 151 return &NewWebUI<CertificateViewerUI>; |
| 152 #endif | 152 #endif |
| 153 if (url.host() == chrome::kChromeUICrashesHost) | 153 if (url.host() == chrome::kChromeUICrashesHost) |
| 154 return &NewWebUI<CrashesUI>; | 154 return &NewWebUI<CrashesUI>; |
| 155 if (url.host() == chrome::kChromeUIDevToolsHost) | 155 if (url.host() == chrome::kChromeUIDevToolsHost) |
| 156 return &NewWebUI<DevToolsUI>; | 156 return &NewWebUI<DevToolsUI>; |
| 157 #if defined(OS_WIN) | 157 #if defined(OS_WIN) |
| 158 if (url.host() == chrome::kChromeUIConflictsHost) | 158 if (url.host() == chrome::kChromeUIConflictsHost) |
| 159 return &NewWebUI<ConflictsUI>; | 159 return &NewWebUI<ConflictsUI>; |
| (...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 383 return FlashUI::GetFaviconResourceBytes(); | 383 return FlashUI::GetFaviconResourceBytes(); |
| 384 | 384 |
| 385 if (page_url.host() == chrome::kChromeUISettingsHost) | 385 if (page_url.host() == chrome::kChromeUISettingsHost) |
| 386 return OptionsUI::GetFaviconResourceBytes(); | 386 return OptionsUI::GetFaviconResourceBytes(); |
| 387 | 387 |
| 388 if (page_url.host() == chrome::kChromeUIPluginsHost) | 388 if (page_url.host() == chrome::kChromeUIPluginsHost) |
| 389 return PluginsUI::GetFaviconResourceBytes(); | 389 return PluginsUI::GetFaviconResourceBytes(); |
| 390 | 390 |
| 391 return NULL; | 391 return NULL; |
| 392 } | 392 } |
| OLD | NEW |