Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(54)

Side by Side Diff: chrome/browser/ui/webui/chrome_web_ui_factory.cc

Issue 8423055: [Aura] Initial app list webui. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: sync and address comments in patch 7 Created 9 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
69 #endif 69 #endif
70 70
71 #if defined(OS_WIN) 71 #if defined(OS_WIN)
72 #include "chrome/browser/ui/webui/conflicts_ui.h" 72 #include "chrome/browser/ui/webui/conflicts_ui.h"
73 #endif 73 #endif
74 74
75 #if defined(OS_POSIX) && !defined(OS_MACOSX) 75 #if defined(OS_POSIX) && !defined(OS_MACOSX)
76 #include "chrome/browser/ui/webui/certificate_viewer_ui.h" 76 #include "chrome/browser/ui/webui/certificate_viewer_ui.h"
77 #endif 77 #endif
78 78
79 #if defined(USE_AURA)
80 #include "chrome/browser/ui/webui/aura/app_list_ui.h"
81 #endif
82
79 namespace { 83 namespace {
80 84
81 // A function for creating a new WebUI. The caller owns the return value, which 85 // A function for creating a new WebUI. The caller owns the return value, which
82 // may be NULL (for example, if the URL refers to an non-existent extension). 86 // may be NULL (for example, if the URL refers to an non-existent extension).
83 typedef ChromeWebUI* (*WebUIFactoryFunction)(TabContents* tab_contents, 87 typedef ChromeWebUI* (*WebUIFactoryFunction)(TabContents* tab_contents,
84 const GURL& url); 88 const GURL& url);
85 89
86 // Template for defining WebUIFactoryFunction. 90 // Template for defining WebUIFactoryFunction.
87 template<class T> 91 template<class T>
88 ChromeWebUI* NewWebUI(TabContents* contents, const GURL& url) { 92 ChromeWebUI* NewWebUI(TabContents* contents, const GURL& url) {
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after
239 #endif // defined(OS_CHROMEOS) 243 #endif // defined(OS_CHROMEOS)
240 244
241 #if (defined(OS_LINUX) && defined(TOOLKIT_VIEWS)) || defined(USE_AURA) 245 #if (defined(OS_LINUX) && defined(TOOLKIT_VIEWS)) || defined(USE_AURA)
242 if (url.host() == chrome::kChromeUICollectedCookiesHost || 246 if (url.host() == chrome::kChromeUICollectedCookiesHost ||
243 url.host() == chrome::kChromeUIHttpAuthHost || 247 url.host() == chrome::kChromeUIHttpAuthHost ||
244 url.host() == chrome::kChromeUIRepostFormWarningHost) { 248 url.host() == chrome::kChromeUIRepostFormWarningHost) {
245 return &NewWebUI<ConstrainedHtmlUI>; 249 return &NewWebUI<ConstrainedHtmlUI>;
246 } 250 }
247 #endif 251 #endif
248 252
253 #if defined(USE_AURA)
254 if (url.host() == chrome::kChromeUIAppListHost)
255 return &NewWebUI<AppListUI>;
256 #endif
257
249 if (url.host() == chrome::kChromeUIPrintHost && 258 if (url.host() == chrome::kChromeUIPrintHost &&
250 switches::IsPrintPreviewEnabled()) { 259 switches::IsPrintPreviewEnabled()) {
251 return &NewWebUI<PrintPreviewUI>; 260 return &NewWebUI<PrintPreviewUI>;
252 } 261 }
253 262
254 if (url.spec() == chrome::kChromeUIConstrainedHTMLTestURL) 263 if (url.spec() == chrome::kChromeUIConstrainedHTMLTestURL)
255 return &NewWebUI<ConstrainedHtmlUI>; 264 return &NewWebUI<ConstrainedHtmlUI>;
256 265
257 #if !defined(OS_CHROMEOS) 266 #if !defined(OS_CHROMEOS)
258 if (url.host() == chrome::kChromeUISyncPromoHost) { 267 if (url.host() == chrome::kChromeUISyncPromoHost) {
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after
406 return FlashUI::GetFaviconResourceBytes(); 415 return FlashUI::GetFaviconResourceBytes();
407 416
408 if (page_url.host() == chrome::kChromeUISettingsHost) 417 if (page_url.host() == chrome::kChromeUISettingsHost)
409 return OptionsUI::GetFaviconResourceBytes(); 418 return OptionsUI::GetFaviconResourceBytes();
410 419
411 if (page_url.host() == chrome::kChromeUIPluginsHost) 420 if (page_url.host() == chrome::kChromeUIPluginsHost)
412 return PluginsUI::GetFaviconResourceBytes(); 421 return PluginsUI::GetFaviconResourceBytes();
413 422
414 return NULL; 423 return NULL;
415 } 424 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698