| 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 <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 269 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 280 #endif // !defined(OS_ANDROID) | 280 #endif // !defined(OS_ANDROID) |
| 281 | 281 |
| 282 #if defined(OS_WIN) | 282 #if defined(OS_WIN) |
| 283 template <> | 283 template <> |
| 284 WebUIController* NewWebUI<WelcomeWin10UI>(WebUI* web_ui, const GURL& url) { | 284 WebUIController* NewWebUI<WelcomeWin10UI>(WebUI* web_ui, const GURL& url) { |
| 285 return new WelcomeWin10UI(web_ui, url); | 285 return new WelcomeWin10UI(web_ui, url); |
| 286 } | 286 } |
| 287 #endif // defined(OS_WIN) | 287 #endif // defined(OS_WIN) |
| 288 | 288 |
| 289 bool IsAboutUI(const GURL& url) { | 289 bool IsAboutUI(const GURL& url) { |
| 290 return (url.host() == chrome::kChromeUIChromeURLsHost || | 290 return (url.host_piece() == chrome::kChromeUIChromeURLsHost || |
| 291 url.host() == chrome::kChromeUICreditsHost || | 291 url.host_piece() == chrome::kChromeUICreditsHost || |
| 292 url.host() == chrome::kChromeUIDNSHost | 292 url.host_piece() == chrome::kChromeUIDNSHost |
| 293 #if !defined(OS_ANDROID) | 293 #if !defined(OS_ANDROID) |
| 294 || url.host() == chrome::kChromeUITermsHost | 294 || url.host_piece() == chrome::kChromeUITermsHost |
| 295 #endif | 295 #endif |
| 296 #if defined(OS_LINUX) || defined(OS_OPENBSD) | 296 #if defined(OS_LINUX) || defined(OS_OPENBSD) |
| 297 || url.host() == chrome::kChromeUILinuxProxyConfigHost || | 297 || url.host_piece() == chrome::kChromeUILinuxProxyConfigHost || |
| 298 url.host() == chrome::kChromeUISandboxHost | 298 url.host_piece() == chrome::kChromeUISandboxHost |
| 299 #endif | 299 #endif |
| 300 #if defined(OS_CHROMEOS) | 300 #if defined(OS_CHROMEOS) |
| 301 || url.host() == chrome::kChromeUIOSCreditsHost | 301 || url.host_piece() == chrome::kChromeUIOSCreditsHost |
| 302 #endif | 302 #endif |
| 303 #if defined(OS_WIN) || defined(OS_MACOSX) || defined(OS_LINUX) | 303 #if defined(OS_WIN) || defined(OS_MACOSX) || defined(OS_LINUX) |
| 304 || url.host() == chrome::kChromeUIDiscardsHost | 304 || url.host_piece() == chrome::kChromeUIDiscardsHost |
| 305 #endif | 305 #endif |
| 306 ); // NOLINT | 306 ); // NOLINT |
| 307 } | 307 } |
| 308 | 308 |
| 309 // Returns a function that can be used to create the right type of WebUI for a | 309 // Returns a function that can be used to create the right type of WebUI for a |
| 310 // tab, based on its URL. Returns NULL if the URL doesn't have WebUI associated | 310 // tab, based on its URL. Returns NULL if the URL doesn't have WebUI associated |
| 311 // with it. | 311 // with it. |
| 312 WebUIFactoryFunction GetWebUIFactoryFunction(WebUI* web_ui, | 312 WebUIFactoryFunction GetWebUIFactoryFunction(WebUI* web_ui, |
| 313 Profile* profile, | 313 Profile* profile, |
| 314 const GURL& url) { | 314 const GURL& url) { |
| (...skipping 11 matching lines...) Expand all Loading... |
| 326 | 326 |
| 327 /**************************************************************************** | 327 /**************************************************************************** |
| 328 * Please keep this in alphabetical order. If #ifs or special logics are | 328 * Please keep this in alphabetical order. If #ifs or special logics are |
| 329 * required, add it below in the appropriate section. | 329 * required, add it below in the appropriate section. |
| 330 ***************************************************************************/ | 330 ***************************************************************************/ |
| 331 // We must compare hosts only since some of the Web UIs append extra stuff | 331 // We must compare hosts only since some of the Web UIs append extra stuff |
| 332 // after the host name. | 332 // after the host name. |
| 333 // All platform builds of Chrome will need to have a cloud printing | 333 // All platform builds of Chrome will need to have a cloud printing |
| 334 // dialog as backup. It's just that on Chrome OS, it's the only | 334 // dialog as backup. It's just that on Chrome OS, it's the only |
| 335 // print dialog. | 335 // print dialog. |
| 336 if (url.host() == chrome::kChromeUIBluetoothInternalsHost) | 336 if (url.host_piece() == chrome::kChromeUIBluetoothInternalsHost) |
| 337 return &NewWebUI<BluetoothInternalsUI>; | 337 return &NewWebUI<BluetoothInternalsUI>; |
| 338 if (url.host() == chrome::kChromeUIComponentsHost) | 338 if (url.host_piece() == chrome::kChromeUIComponentsHost) |
| 339 return &NewWebUI<ComponentsUI>; | 339 return &NewWebUI<ComponentsUI>; |
| 340 if (url.spec() == chrome::kChromeUIConstrainedHTMLTestURL) | 340 if (url.spec() == chrome::kChromeUIConstrainedHTMLTestURL) |
| 341 return &NewWebUI<ConstrainedWebDialogUI>; | 341 return &NewWebUI<ConstrainedWebDialogUI>; |
| 342 if (url.host() == chrome::kChromeUICrashesHost) | 342 if (url.host_piece() == chrome::kChromeUICrashesHost) |
| 343 return &NewWebUI<CrashesUI>; | 343 return &NewWebUI<CrashesUI>; |
| 344 if (url.host() == chrome::kChromeUIDeviceLogHost) | 344 if (url.host_piece() == chrome::kChromeUIDeviceLogHost) |
| 345 return &NewWebUI<chromeos::DeviceLogUI>; | 345 return &NewWebUI<chromeos::DeviceLogUI>; |
| 346 if (url.host() == chrome::kChromeUIDomainReliabilityInternalsHost) | 346 if (url.host_piece() == chrome::kChromeUIDomainReliabilityInternalsHost) |
| 347 return &NewWebUI<DomainReliabilityInternalsUI>; | 347 return &NewWebUI<DomainReliabilityInternalsUI>; |
| 348 if (url.host() == chrome::kChromeUIFlagsHost) | 348 if (url.host_piece() == chrome::kChromeUIFlagsHost) |
| 349 return &NewWebUI<FlagsUI>; | 349 return &NewWebUI<FlagsUI>; |
| 350 if (url.host() == chrome::kChromeUIGCMInternalsHost) | 350 if (url.host_piece() == chrome::kChromeUIGCMInternalsHost) |
| 351 return &NewWebUI<GCMInternalsUI>; | 351 return &NewWebUI<GCMInternalsUI>; |
| 352 if (url.host() == chrome::kChromeUIHistoryFrameHost) | 352 if (url.host_piece() == chrome::kChromeUIHistoryFrameHost) |
| 353 return &NewWebUI<HistoryUI>; | 353 return &NewWebUI<HistoryUI>; |
| 354 if (url.host() == chrome::kChromeUIInstantHost) | 354 if (url.host_piece() == chrome::kChromeUIInstantHost) |
| 355 return &NewWebUI<InstantUI>; | 355 return &NewWebUI<InstantUI>; |
| 356 if (url.host() == chrome::kChromeUIInterstitialHost) | 356 if (url.host_piece() == chrome::kChromeUIInterstitialHost) |
| 357 return &NewWebUI<InterstitialUI>; | 357 return &NewWebUI<InterstitialUI>; |
| 358 if (url.host() == chrome::kChromeUIInvalidationsHost) | 358 if (url.host_piece() == chrome::kChromeUIInvalidationsHost) |
| 359 return &NewWebUI<InvalidationsUI>; | 359 return &NewWebUI<InvalidationsUI>; |
| 360 if (url.host() == chrome::kChromeUILocalStateHost) | 360 if (url.host_piece() == chrome::kChromeUILocalStateHost) |
| 361 return &NewWebUI<LocalStateUI>; | 361 return &NewWebUI<LocalStateUI>; |
| 362 if (url.host() == chrome::kChromeUINetExportHost) | 362 if (url.host_piece() == chrome::kChromeUINetExportHost) |
| 363 return &NewWebUI<NetExportUI>; | 363 return &NewWebUI<NetExportUI>; |
| 364 if (url.host() == chrome::kChromeUINetInternalsHost) | 364 if (url.host_piece() == chrome::kChromeUINetInternalsHost) |
| 365 return &NewWebUI<NetInternalsUI>; | 365 return &NewWebUI<NetInternalsUI>; |
| 366 if (url.host() == chrome::kChromeUIOmniboxHost) | 366 if (url.host_piece() == chrome::kChromeUIOmniboxHost) |
| 367 return &NewWebUI<OmniboxUI>; | 367 return &NewWebUI<OmniboxUI>; |
| 368 if (url.host() == chrome::kChromeUIPasswordManagerInternalsHost) | 368 if (url.host_piece() == chrome::kChromeUIPasswordManagerInternalsHost) |
| 369 return &NewWebUI<PasswordManagerInternalsUI>; | 369 return &NewWebUI<PasswordManagerInternalsUI>; |
| 370 if (url.host() == chrome::kChromeUIPredictorsHost) | 370 if (url.host_piece() == chrome::kChromeUIPredictorsHost) |
| 371 return &NewWebUI<PredictorsUI>; | 371 return &NewWebUI<PredictorsUI>; |
| 372 if (url.host() == chrome::kChromeUIProfilerHost) | 372 if (url.host_piece() == chrome::kChromeUIProfilerHost) |
| 373 return &NewWebUI<ProfilerUI>; | 373 return &NewWebUI<ProfilerUI>; |
| 374 if (url.host() == chrome::kChromeUISignInInternalsHost) | 374 if (url.host_piece() == chrome::kChromeUISignInInternalsHost) |
| 375 return &NewWebUI<SignInInternalsUI>; | 375 return &NewWebUI<SignInInternalsUI>; |
| 376 if (url.host() == chrome::kChromeUISuggestionsHost) | 376 if (url.host_piece() == chrome::kChromeUISuggestionsHost) |
| 377 return &NewWebUI<suggestions::SuggestionsUI>; | 377 return &NewWebUI<suggestions::SuggestionsUI>; |
| 378 if (url.host() == chrome::kChromeUISupervisedUserInternalsHost) | 378 if (url.host_piece() == chrome::kChromeUISupervisedUserInternalsHost) |
| 379 return &NewWebUI<SupervisedUserInternalsUI>; | 379 return &NewWebUI<SupervisedUserInternalsUI>; |
| 380 if (url.host() == chrome::kChromeUISupervisedUserPassphrasePageHost) | 380 if (url.host_piece() == chrome::kChromeUISupervisedUserPassphrasePageHost) |
| 381 return &NewWebUI<ConstrainedWebDialogUI>; | 381 return &NewWebUI<ConstrainedWebDialogUI>; |
| 382 if (url.host() == chrome::kChromeUISyncInternalsHost) | 382 if (url.host_piece() == chrome::kChromeUISyncInternalsHost) |
| 383 return &NewWebUI<SyncInternalsUI>; | 383 return &NewWebUI<SyncInternalsUI>; |
| 384 if (url.host() == chrome::kChromeUISyncResourcesHost) | 384 if (url.host_piece() == chrome::kChromeUISyncResourcesHost) |
| 385 return &NewWebUI<WebDialogUI>; | 385 return &NewWebUI<WebDialogUI>; |
| 386 if (url.host() == chrome::kChromeUITaskSchedulerInternalsHost) | 386 if (url.host_piece() == chrome::kChromeUITaskSchedulerInternalsHost) |
| 387 return &NewWebUI<TaskSchedulerInternalsUI>; | 387 return &NewWebUI<TaskSchedulerInternalsUI>; |
| 388 if (url.host() == chrome::kChromeUITranslateInternalsHost) | 388 if (url.host_piece() == chrome::kChromeUITranslateInternalsHost) |
| 389 return &NewWebUI<TranslateInternalsUI>; | 389 return &NewWebUI<TranslateInternalsUI>; |
| 390 if (url.host() == chrome::kChromeUIUsbInternalsHost) | 390 if (url.host_piece() == chrome::kChromeUIUsbInternalsHost) |
| 391 return &NewWebUI<UsbInternalsUI>; | 391 return &NewWebUI<UsbInternalsUI>; |
| 392 if (url.host() == chrome::kChromeUIUserActionsHost) | 392 if (url.host_piece() == chrome::kChromeUIUserActionsHost) |
| 393 return &NewWebUI<UserActionsUI>; | 393 return &NewWebUI<UserActionsUI>; |
| 394 if (url.host() == chrome::kChromeUIVersionHost) | 394 if (url.host_piece() == chrome::kChromeUIVersionHost) |
| 395 return &NewWebUI<VersionUI>; | 395 return &NewWebUI<VersionUI>; |
| 396 | 396 |
| 397 /**************************************************************************** | 397 /**************************************************************************** |
| 398 * OS Specific #defines | 398 * OS Specific #defines |
| 399 ***************************************************************************/ | 399 ***************************************************************************/ |
| 400 #if !defined(OS_ANDROID) | 400 #if !defined(OS_ANDROID) |
| 401 #if !defined(OS_CHROMEOS) | 401 #if !defined(OS_CHROMEOS) |
| 402 // AppLauncherPage is not needed on Android or ChromeOS. | 402 // AppLauncherPage is not needed on Android or ChromeOS. |
| 403 if (url.host() == chrome::kChromeUIAppLauncherPageHost && | 403 if (url.host_piece() == chrome::kChromeUIAppLauncherPageHost && profile && |
| 404 profile && extensions::ExtensionSystem::Get(profile)-> | 404 extensions::ExtensionSystem::Get(profile)->extension_service()) { |
| 405 extension_service()) { | |
| 406 return &NewWebUI<AppLauncherPageUI>; | 405 return &NewWebUI<AppLauncherPageUI>; |
| 407 } | 406 } |
| 408 #endif // !defined(OS_CHROMEOS) | 407 #endif // !defined(OS_CHROMEOS) |
| 409 | 408 |
| 410 // Bookmarks are part of NTP on Android. | 409 // Bookmarks are part of NTP on Android. |
| 411 if (url.host() == chrome::kChromeUIBookmarksHost) { | 410 if (url.host_piece() == chrome::kChromeUIBookmarksHost) { |
| 412 return MdBookmarksUI::IsEnabled() ? &NewWebUI<MdBookmarksUI> | 411 return MdBookmarksUI::IsEnabled() ? &NewWebUI<MdBookmarksUI> |
| 413 : &NewWebUI<BookmarksUI>; | 412 : &NewWebUI<BookmarksUI>; |
| 414 } | 413 } |
| 415 // Downloads list on Android uses the built-in download manager. | 414 // Downloads list on Android uses the built-in download manager. |
| 416 if (url.host() == chrome::kChromeUIDownloadsHost) | 415 if (url.host_piece() == chrome::kChromeUIDownloadsHost) |
| 417 return &NewWebUI<MdDownloadsUI>; | 416 return &NewWebUI<MdDownloadsUI>; |
| 418 // Material Design feedback. Feedback is implemented separately in | 417 // Material Design feedback. Feedback is implemented separately in |
| 419 // Android. | 418 // Android. |
| 420 if (url.host() == chrome::kChromeUIFeedbackHost && | 419 if (url.host_piece() == chrome::kChromeUIFeedbackHost && |
| 421 ::switches::MdFeedbackEnabled()) { | 420 ::switches::MdFeedbackEnabled()) { |
| 422 return &NewWebUI<MdFeedbackUI>; | 421 return &NewWebUI<MdFeedbackUI>; |
| 423 } | 422 } |
| 424 // Help is implemented with native UI elements on Android. | 423 // Help is implemented with native UI elements on Android. |
| 425 if (url.host() == chrome::kChromeUIHelpFrameHost) | 424 if (url.host_piece() == chrome::kChromeUIHelpFrameHost) |
| 426 return &NewWebUI<HelpUI>; | 425 return &NewWebUI<HelpUI>; |
| 427 // Identity API is not available on Android. | 426 // Identity API is not available on Android. |
| 428 if (url.host() == chrome::kChromeUIIdentityInternalsHost) | 427 if (url.host_piece() == chrome::kChromeUIIdentityInternalsHost) |
| 429 return &NewWebUI<IdentityInternalsUI>; | 428 return &NewWebUI<IdentityInternalsUI>; |
| 430 if (url.host() == chrome::kChromeUINewTabHost) | 429 if (url.host_piece() == chrome::kChromeUINewTabHost) |
| 431 return &NewWebUI<NewTabUI>; | 430 return &NewWebUI<NewTabUI>; |
| 432 if (url.host() == chrome::kChromeUIMdSettingsHost) | 431 if (url.host_piece() == chrome::kChromeUIMdSettingsHost) |
| 433 return &NewWebUI<settings::MdSettingsUI>; | 432 return &NewWebUI<settings::MdSettingsUI>; |
| 434 // If the material design extensions page is enabled, it gets its own host. | 433 // If the material design extensions page is enabled, it gets its own host. |
| 435 // Otherwise, it's handled by the uber settings page. | 434 // Otherwise, it's handled by the uber settings page. |
| 436 if (url.host() == chrome::kChromeUIExtensionsHost && | 435 if (url.host_piece() == chrome::kChromeUIExtensionsHost && |
| 437 base::FeatureList::IsEnabled(features::kMaterialDesignExtensions)) { | 436 base::FeatureList::IsEnabled(features::kMaterialDesignExtensions)) { |
| 438 return &NewWebUI<extensions::ExtensionsUI>; | 437 return &NewWebUI<extensions::ExtensionsUI>; |
| 439 } | 438 } |
| 440 // Material Design history is on its own host, rather than on an Uber page. | 439 // Material Design history is on its own host, rather than on an Uber page. |
| 441 if (MdHistoryUI::IsEnabled(profile) && | 440 if (MdHistoryUI::IsEnabled(profile) && |
| 442 url.host() == chrome::kChromeUIHistoryHost) { | 441 url.host_piece() == chrome::kChromeUIHistoryHost) { |
| 443 return &NewWebUI<MdHistoryUI>; | 442 return &NewWebUI<MdHistoryUI>; |
| 444 } | 443 } |
| 445 // Material Design Settings gets its own host, if enabled. | 444 // Material Design Settings gets its own host, if enabled. |
| 446 if (base::FeatureList::IsEnabled(features::kMaterialDesignSettings) && | 445 if (base::FeatureList::IsEnabled(features::kMaterialDesignSettings) && |
| 447 url.host() == chrome::kChromeUISettingsHost) { | 446 url.host_piece() == chrome::kChromeUISettingsHost) { |
| 448 return &NewWebUI<settings::MdSettingsUI>; | 447 return &NewWebUI<settings::MdSettingsUI>; |
| 449 } | 448 } |
| 450 if (url.host() == chrome::kChromeUIQuotaInternalsHost) | 449 if (url.host_piece() == chrome::kChromeUIQuotaInternalsHost) |
| 451 return &NewWebUI<QuotaInternalsUI>; | 450 return &NewWebUI<QuotaInternalsUI>; |
| 452 // Settings are implemented with native UI elements on Android. | 451 // Settings are implemented with native UI elements on Android. |
| 453 // Handle chrome://settings if settings in a window and about in settings | 452 // Handle chrome://settings if settings in a window and about in settings |
| 454 // are enabled. | 453 // are enabled. |
| 455 if (url.host() == chrome::kChromeUISettingsFrameHost || | 454 if (url.host_piece() == chrome::kChromeUISettingsFrameHost || |
| 456 (url.host() == chrome::kChromeUISettingsHost && | 455 (url.host_piece() == chrome::kChromeUISettingsHost && |
| 457 ::switches::AboutInSettingsEnabled())) { | 456 ::switches::AboutInSettingsEnabled())) { |
| 458 return &NewWebUI<options::OptionsUI>; | 457 return &NewWebUI<options::OptionsUI>; |
| 459 } | 458 } |
| 460 if (url.host() == chrome::kChromeUISyncFileSystemInternalsHost) | 459 if (url.host_piece() == chrome::kChromeUISyncFileSystemInternalsHost) |
| 461 return &NewWebUI<SyncFileSystemInternalsUI>; | 460 return &NewWebUI<SyncFileSystemInternalsUI>; |
| 462 if (url.host() == chrome::kChromeUISystemInfoHost) | 461 if (url.host_piece() == chrome::kChromeUISystemInfoHost) |
| 463 return &NewWebUI<SystemInfoUI>; | 462 return &NewWebUI<SystemInfoUI>; |
| 464 // Uber frame is not used on Android. | 463 // Uber frame is not used on Android. |
| 465 if (url.host() == chrome::kChromeUIUberFrameHost) | 464 if (url.host_piece() == chrome::kChromeUIUberFrameHost) |
| 466 return &NewWebUI<UberFrameUI>; | 465 return &NewWebUI<UberFrameUI>; |
| 467 // Uber page is not used on Android. | 466 // Uber page is not used on Android. |
| 468 if (url.host() == chrome::kChromeUIUberHost) | 467 if (url.host_piece() == chrome::kChromeUIUberHost) |
| 469 return &NewWebUI<UberUI>; | 468 return &NewWebUI<UberUI>; |
| 470 #endif // !defined(OS_ANDROID) | 469 #endif // !defined(OS_ANDROID) |
| 471 #if defined(OS_WIN) | 470 #if defined(OS_WIN) |
| 472 if (url.host() == chrome::kChromeUIConflictsHost) | 471 if (url.host_piece() == chrome::kChromeUIConflictsHost) |
| 473 return &NewWebUI<ConflictsUI>; | 472 return &NewWebUI<ConflictsUI>; |
| 474 if (url.host() == chrome::kChromeUIMetroFlowHost) | 473 if (url.host_piece() == chrome::kChromeUIMetroFlowHost) |
| 475 return &NewWebUI<SetAsDefaultBrowserUI>; | 474 return &NewWebUI<SetAsDefaultBrowserUI>; |
| 476 #endif | 475 #endif |
| 477 #if defined(OS_CHROMEOS) | 476 #if defined(OS_CHROMEOS) |
| 478 if (url.host() == chrome::kChromeUIBluetoothPairingHost) | 477 if (url.host_piece() == chrome::kChromeUIBluetoothPairingHost) |
| 479 return &NewWebUI<chromeos::BluetoothPairingUI>; | 478 return &NewWebUI<chromeos::BluetoothPairingUI>; |
| 480 if (url.host() == chrome::kChromeUICertificateManagerHost) | 479 if (url.host_piece() == chrome::kChromeUICertificateManagerHost) |
| 481 return &NewWebUI<chromeos::CertificateManagerDialogUI>; | 480 return &NewWebUI<chromeos::CertificateManagerDialogUI>; |
| 482 if (url.host() == chrome::kChromeUIChooseMobileNetworkHost) | 481 if (url.host_piece() == chrome::kChromeUIChooseMobileNetworkHost) |
| 483 return &NewWebUI<chromeos::ChooseMobileNetworkUI>; | 482 return &NewWebUI<chromeos::ChooseMobileNetworkUI>; |
| 484 if (url.host() == chrome::kChromeUICryptohomeHost) | 483 if (url.host_piece() == chrome::kChromeUICryptohomeHost) |
| 485 return &NewWebUI<chromeos::CryptohomeUI>; | 484 return &NewWebUI<chromeos::CryptohomeUI>; |
| 486 if (url.host() == chrome::kChromeUIDriveInternalsHost) | 485 if (url.host_piece() == chrome::kChromeUIDriveInternalsHost) |
| 487 return &NewWebUI<chromeos::DriveInternalsUI>; | 486 return &NewWebUI<chromeos::DriveInternalsUI>; |
| 488 if (url.host() == chrome::kChromeUIFirstRunHost) | 487 if (url.host_piece() == chrome::kChromeUIFirstRunHost) |
| 489 return &NewWebUI<chromeos::FirstRunUI>; | 488 return &NewWebUI<chromeos::FirstRunUI>; |
| 490 if (url.host() == chrome::kChromeUIKeyboardOverlayHost) | 489 if (url.host_piece() == chrome::kChromeUIKeyboardOverlayHost) |
| 491 return &NewWebUI<KeyboardOverlayUI>; | 490 return &NewWebUI<KeyboardOverlayUI>; |
| 492 if (url.host() == chrome::kChromeUIMobileSetupHost) | 491 if (url.host_piece() == chrome::kChromeUIMobileSetupHost) |
| 493 return &NewWebUI<MobileSetupUI>; | 492 return &NewWebUI<MobileSetupUI>; |
| 494 if (url.host() == chrome::kChromeUINetworkHost) | 493 if (url.host_piece() == chrome::kChromeUINetworkHost) |
| 495 return &NewWebUI<chromeos::NetworkUI>; | 494 return &NewWebUI<chromeos::NetworkUI>; |
| 496 if (url.host() == chrome::kChromeUIOobeHost) | 495 if (url.host_piece() == chrome::kChromeUIOobeHost) |
| 497 return &NewWebUI<chromeos::OobeUI>; | 496 return &NewWebUI<chromeos::OobeUI>; |
| 498 if (url.host() == chrome::kChromeUIPowerHost) | 497 if (url.host_piece() == chrome::kChromeUIPowerHost) |
| 499 return &NewWebUI<chromeos::PowerUI>; | 498 return &NewWebUI<chromeos::PowerUI>; |
| 500 if (url.host() == proximity_auth::kChromeUIProximityAuthHost) | 499 if (url.host_piece() == proximity_auth::kChromeUIProximityAuthHost) |
| 501 return &NewWebUI<proximity_auth::ProximityAuthUI>; | 500 return &NewWebUI<proximity_auth::ProximityAuthUI>; |
| 502 if (url.host() == chrome::kChromeUIProxySettingsHost) | 501 if (url.host_piece() == chrome::kChromeUIProxySettingsHost) |
| 503 return &NewWebUI<chromeos::ProxySettingsUI>; | 502 return &NewWebUI<chromeos::ProxySettingsUI>; |
| 504 if (url.host() == chrome::kChromeUISetTimeHost) | 503 if (url.host_piece() == chrome::kChromeUISetTimeHost) |
| 505 return &NewWebUI<chromeos::SetTimeUI>; | 504 return &NewWebUI<chromeos::SetTimeUI>; |
| 506 if (url.host() == chrome::kChromeUISimUnlockHost) | 505 if (url.host_piece() == chrome::kChromeUISimUnlockHost) |
| 507 return &NewWebUI<chromeos::SimUnlockUI>; | 506 return &NewWebUI<chromeos::SimUnlockUI>; |
| 508 if (url.host() == chrome::kChromeUISlowHost) | 507 if (url.host_piece() == chrome::kChromeUISlowHost) |
| 509 return &NewWebUI<chromeos::SlowUI>; | 508 return &NewWebUI<chromeos::SlowUI>; |
| 510 if (url.host() == chrome::kChromeUISlowTraceHost) | 509 if (url.host_piece() == chrome::kChromeUISlowTraceHost) |
| 511 return &NewWebUI<chromeos::SlowTraceController>; | 510 return &NewWebUI<chromeos::SlowTraceController>; |
| 512 if (url.host() == chrome::kChromeUIVoiceSearchHost) | 511 if (url.host_piece() == chrome::kChromeUIVoiceSearchHost) |
| 513 return &NewWebUI<VoiceSearchUI>; | 512 return &NewWebUI<VoiceSearchUI>; |
| 514 #if !defined(NDEBUG) | 513 #if !defined(NDEBUG) |
| 515 if (!base::SysInfo::IsRunningOnChromeOS()) { | 514 if (!base::SysInfo::IsRunningOnChromeOS()) { |
| 516 if (url.host() == chrome::kChromeUIDeviceEmulatorHost) | 515 if (url.host_piece() == chrome::kChromeUIDeviceEmulatorHost) |
| 517 return &NewWebUI<DeviceEmulatorUI>; | 516 return &NewWebUI<DeviceEmulatorUI>; |
| 518 } | 517 } |
| 519 #endif // !defined(NDEBUG) | 518 #endif // !defined(NDEBUG) |
| 520 #endif // defined(OS_CHROMEOS) | 519 #endif // defined(OS_CHROMEOS) |
| 521 #if defined(OS_ANDROID) | 520 #if defined(OS_ANDROID) |
| 522 if (url.host() == chrome::kChromeUIOfflineInternalsHost) | 521 if (url.host_piece() == chrome::kChromeUIOfflineInternalsHost) |
| 523 return &NewWebUI<OfflineInternalsUI>; | 522 return &NewWebUI<OfflineInternalsUI>; |
| 524 if (url.host() == chrome::kChromeUIPopularSitesInternalsHost) | 523 if (url.host_piece() == chrome::kChromeUIPopularSitesInternalsHost) |
| 525 return &NewWebUI<PopularSitesInternalsUI>; | 524 return &NewWebUI<PopularSitesInternalsUI>; |
| 526 if (url.host() == chrome::kChromeUISnippetsInternalsHost && | 525 if (url.host_piece() == chrome::kChromeUISnippetsInternalsHost && |
| 527 !profile->IsOffTheRecord()) | 526 !profile->IsOffTheRecord()) |
| 528 return &NewWebUI<SnippetsInternalsUI>; | 527 return &NewWebUI<SnippetsInternalsUI>; |
| 529 #if defined(ENABLE_VR_SHELL) || defined(ENABLE_WEBVR) | 528 #if defined(ENABLE_VR_SHELL) || defined(ENABLE_WEBVR) |
| 530 if (url.host() == chrome::kChromeUIVrShellUIHost) | 529 if (url.host_piece() == chrome::kChromeUIVrShellUIHost) |
| 531 return &NewWebUI<VrShellUIUI>; | 530 return &NewWebUI<VrShellUIUI>; |
| 532 #endif | 531 #endif |
| 533 #else | 532 #else |
| 534 if (url.SchemeIs(content::kChromeDevToolsScheme)) | 533 if (url.SchemeIs(content::kChromeDevToolsScheme)) |
| 535 return &NewWebUI<DevToolsUI>; | 534 return &NewWebUI<DevToolsUI>; |
| 536 | 535 |
| 537 // chrome://inspect isn't supported on Android nor iOS. Page debugging is | 536 // chrome://inspect isn't supported on Android nor iOS. Page debugging is |
| 538 // handled by a remote devtools on the host machine, and other elements, i.e. | 537 // handled by a remote devtools on the host machine, and other elements, i.e. |
| 539 // extensions aren't supported. | 538 // extensions aren't supported. |
| 540 if (url.host() == chrome::kChromeUIInspectHost) | 539 if (url.host_piece() == chrome::kChromeUIInspectHost) |
| 541 return &NewWebUI<InspectUI>; | 540 return &NewWebUI<InspectUI>; |
| 542 #endif | 541 #endif |
| 543 #if !defined(OS_CHROMEOS) && !defined(OS_ANDROID) | 542 #if !defined(OS_CHROMEOS) && !defined(OS_ANDROID) |
| 544 if (url.host() == chrome::kChromeUIChromeSigninHost) | 543 if (url.host_piece() == chrome::kChromeUIChromeSigninHost) |
| 545 return &NewWebUI<InlineLoginUI>; | 544 return &NewWebUI<InlineLoginUI>; |
| 546 if (url.host() == chrome::kChromeUIMdUserManagerHost) | 545 if (url.host_piece() == chrome::kChromeUIMdUserManagerHost) |
| 547 return &NewWebUI<MDUserManagerUI>; | 546 return &NewWebUI<MDUserManagerUI>; |
| 548 if (url.host() == chrome::kChromeUISigninErrorHost) | 547 if (url.host_piece() == chrome::kChromeUISigninErrorHost) |
| 549 return &NewWebUI<SigninErrorUI>; | 548 return &NewWebUI<SigninErrorUI>; |
| 550 if (url.host() == chrome::kChromeUISyncConfirmationHost) | 549 if (url.host_piece() == chrome::kChromeUISyncConfirmationHost) |
| 551 return &NewWebUI<SyncConfirmationUI>; | 550 return &NewWebUI<SyncConfirmationUI>; |
| 552 if (url.host() == chrome::kChromeUIProfileSigninConfirmationHost) | 551 if (url.host_piece() == chrome::kChromeUIProfileSigninConfirmationHost) |
| 553 return &NewWebUI<ProfileSigninConfirmationUI>; | 552 return &NewWebUI<ProfileSigninConfirmationUI>; |
| 554 if (url.host() == chrome::kChromeUIWelcomeHost) | 553 if (url.host_piece() == chrome::kChromeUIWelcomeHost) |
| 555 return &NewWebUI<WelcomeUI>; | 554 return &NewWebUI<WelcomeUI>; |
| 556 #endif | 555 #endif |
| 557 #if defined(OS_WIN) | 556 #if defined(OS_WIN) |
| 558 if (url.host() == chrome::kChromeUIWelcomeWin10Host) | 557 if (url.host_piece() == chrome::kChromeUIWelcomeWin10Host) |
| 559 return &NewWebUI<WelcomeWin10UI>; | 558 return &NewWebUI<WelcomeWin10UI>; |
| 560 #endif // defined(OS_WIN) | 559 #endif // defined(OS_WIN) |
| 561 | 560 |
| 562 /**************************************************************************** | 561 /**************************************************************************** |
| 563 * Other #defines and special logics. | 562 * Other #defines and special logics. |
| 564 ***************************************************************************/ | 563 ***************************************************************************/ |
| 565 #if !defined(DISABLE_NACL) | 564 #if !defined(DISABLE_NACL) |
| 566 if (url.host() == chrome::kChromeUINaClHost) | 565 if (url.host_piece() == chrome::kChromeUINaClHost) |
| 567 return &NewWebUI<NaClUI>; | 566 return &NewWebUI<NaClUI>; |
| 568 #endif | 567 #endif |
| 569 #if (defined(OS_LINUX) && defined(TOOLKIT_VIEWS)) || defined(USE_AURA) | 568 #if (defined(OS_LINUX) && defined(TOOLKIT_VIEWS)) || defined(USE_AURA) |
| 570 if (url.host() == chrome::kChromeUITabModalConfirmDialogHost) { | 569 if (url.host_piece() == chrome::kChromeUITabModalConfirmDialogHost) { |
| 571 return &NewWebUI<ConstrainedWebDialogUI>; | 570 return &NewWebUI<ConstrainedWebDialogUI>; |
| 572 } | 571 } |
| 573 #endif | 572 #endif |
| 574 #if (defined(USE_NSS_CERTS) || defined(USE_OPENSSL_CERTS)) && defined(USE_AURA) | 573 #if (defined(USE_NSS_CERTS) || defined(USE_OPENSSL_CERTS)) && defined(USE_AURA) |
| 575 if (url.host() == chrome::kChromeUICertificateViewerHost) | 574 if (url.host_piece() == chrome::kChromeUICertificateViewerHost) |
| 576 return &NewWebUI<CertificateViewerUI>; | 575 return &NewWebUI<CertificateViewerUI>; |
| 577 #if defined(OS_CHROMEOS) | 576 #if defined(OS_CHROMEOS) |
| 578 if (url.host() == chrome::kChromeUICertificateViewerDialogHost) | 577 if (url.host_piece() == chrome::kChromeUICertificateViewerDialogHost) |
| 579 return &NewWebUI<CertificateViewerModalDialogUI>; | 578 return &NewWebUI<CertificateViewerModalDialogUI>; |
| 580 #endif | 579 #endif |
| 581 #endif // (USE_NSS_CERTS || USE_OPENSSL_CERTS) && USE_AURA | 580 #endif // (USE_NSS_CERTS || USE_OPENSSL_CERTS) && USE_AURA |
| 582 | 581 |
| 583 if (url.host() == chrome::kChromeUIPolicyHost) | 582 if (url.host_piece() == chrome::kChromeUIPolicyHost) |
| 584 return &NewWebUI<PolicyUI>; | 583 return &NewWebUI<PolicyUI>; |
| 585 if (url.host() == chrome::kChromeUIMdPolicyHost && | 584 if (url.host_piece() == chrome::kChromeUIMdPolicyHost && |
| 586 switches::MdPolicyPageEnabled()) { | 585 switches::MdPolicyPageEnabled()) { |
| 587 return &NewWebUI<PolicyMaterialDesignUI>; | 586 return &NewWebUI<PolicyMaterialDesignUI>; |
| 588 } | 587 } |
| 589 | 588 |
| 590 #if BUILDFLAG(ENABLE_APP_LIST) | 589 #if BUILDFLAG(ENABLE_APP_LIST) |
| 591 if (url.host() == chrome::kChromeUIAppListStartPageHost) | 590 if (url.host_piece() == chrome::kChromeUIAppListStartPageHost) |
| 592 return &NewWebUI<app_list::StartPageUI>; | 591 return &NewWebUI<app_list::StartPageUI>; |
| 593 #endif | 592 #endif |
| 594 #if defined(ENABLE_EXTENSIONS) | 593 #if defined(ENABLE_EXTENSIONS) |
| 595 if (url.host() == chrome::kChromeUIExtensionsFrameHost) | 594 if (url.host_piece() == chrome::kChromeUIExtensionsFrameHost) |
| 596 return &NewWebUI<extensions::ExtensionsUI>; | 595 return &NewWebUI<extensions::ExtensionsUI>; |
| 597 #endif | 596 #endif |
| 598 #if defined(ENABLE_PLUGINS) | 597 #if defined(ENABLE_PLUGINS) |
| 599 if (url.host() == chrome::kChromeUIFlashHost) | 598 if (url.host_piece() == chrome::kChromeUIFlashHost) |
| 600 return &NewWebUI<FlashUI>; | 599 return &NewWebUI<FlashUI>; |
| 601 if (url.host() == chrome::kChromeUIPluginsHost) | 600 if (url.host_piece() == chrome::kChromeUIPluginsHost) |
| 602 return &NewWebUI<PluginsUI>; | 601 return &NewWebUI<PluginsUI>; |
| 603 #endif | 602 #endif |
| 604 #if BUILDFLAG(ENABLE_PRINT_PREVIEW) | 603 #if BUILDFLAG(ENABLE_PRINT_PREVIEW) |
| 605 if (url.host() == chrome::kChromeUIPrintHost && | 604 if (url.host_piece() == chrome::kChromeUIPrintHost && |
| 606 !profile->GetPrefs()->GetBoolean(prefs::kPrintPreviewDisabled)) { | 605 !profile->GetPrefs()->GetBoolean(prefs::kPrintPreviewDisabled)) { |
| 607 return &NewWebUI<PrintPreviewUI>; | 606 return &NewWebUI<PrintPreviewUI>; |
| 608 } | 607 } |
| 609 #endif | 608 #endif |
| 610 #if BUILDFLAG(ENABLE_SERVICE_DISCOVERY) | 609 #if BUILDFLAG(ENABLE_SERVICE_DISCOVERY) |
| 611 if (url.host() == chrome::kChromeUIDevicesHost) { | 610 if (url.host_piece() == chrome::kChromeUIDevicesHost) { |
| 612 return &NewWebUI<LocalDiscoveryUI>; | 611 return &NewWebUI<LocalDiscoveryUI>; |
| 613 } | 612 } |
| 614 #endif | 613 #endif |
| 615 #if defined(ENABLE_WEBRTC) | 614 #if defined(ENABLE_WEBRTC) |
| 616 if (url.host() == chrome::kChromeUIWebRtcLogsHost) | 615 if (url.host_piece() == chrome::kChromeUIWebRtcLogsHost) |
| 617 return &NewWebUI<WebRtcLogsUI>; | 616 return &NewWebUI<WebRtcLogsUI>; |
| 618 #endif | 617 #endif |
| 619 #if defined(ENABLE_MEDIA_ROUTER) | 618 #if defined(ENABLE_MEDIA_ROUTER) |
| 620 #if !defined(OS_ANDROID) | 619 #if !defined(OS_ANDROID) |
| 621 if (url.host() == chrome::kChromeUIMediaRouterHost && | 620 if (url.host_piece() == chrome::kChromeUIMediaRouterHost && |
| 622 media_router::MediaRouterEnabled(profile)) { | 621 media_router::MediaRouterEnabled(profile)) { |
| 623 return &NewWebUI<media_router::MediaRouterUI>; | 622 return &NewWebUI<media_router::MediaRouterUI>; |
| 624 } | 623 } |
| 625 #endif | 624 #endif |
| 626 #if defined(OS_WIN) || defined(OS_MACOSX) || defined(OS_CHROMEOS) | 625 #if defined(OS_WIN) || defined(OS_MACOSX) || defined(OS_CHROMEOS) |
| 627 if (url.host() == chrome::kChromeUICastHost && | 626 if (url.host_piece() == chrome::kChromeUICastHost && |
| 628 media_router::MediaRouterEnabled(profile)) { | 627 media_router::MediaRouterEnabled(profile)) { |
| 629 return &NewWebUI<CastUI>; | 628 return &NewWebUI<CastUI>; |
| 630 } | 629 } |
| 631 #endif | 630 #endif |
| 632 #endif | 631 #endif |
| 633 if (IsAboutUI(url)) | 632 if (IsAboutUI(url)) |
| 634 return &NewWebUI<AboutUI>; | 633 return &NewWebUI<AboutUI>; |
| 635 | 634 |
| 636 if (dom_distiller::IsEnableDomDistillerSet() && | 635 if (dom_distiller::IsEnableDomDistillerSet() && |
| 637 url.host() == dom_distiller::kChromeUIDomDistillerHost) { | 636 url.host_piece() == dom_distiller::kChromeUIDomDistillerHost) { |
| 638 return &NewWebUI<dom_distiller::DomDistillerUi>; | 637 return &NewWebUI<dom_distiller::DomDistillerUi>; |
| 639 } | 638 } |
| 640 | 639 |
| 641 if (SiteEngagementService::IsEnabled() && | 640 if (SiteEngagementService::IsEnabled() && |
| 642 url.host() == chrome::kChromeUISiteEngagementHost) { | 641 url.host_piece() == chrome::kChromeUISiteEngagementHost) { |
| 643 return &NewWebUI<SiteEngagementUI>; | 642 return &NewWebUI<SiteEngagementUI>; |
| 644 } | 643 } |
| 645 | 644 |
| 646 return NULL; | 645 return NULL; |
| 647 } | 646 } |
| 648 | 647 |
| 649 void RunFaviconCallbackAsync( | 648 void RunFaviconCallbackAsync( |
| 650 const favicon_base::FaviconResultsCallback& callback, | 649 const favicon_base::FaviconResultsCallback& callback, |
| 651 const std::vector<favicon_base::FaviconRawBitmapResult>* results) { | 650 const std::vector<favicon_base::FaviconRawBitmapResult>* results) { |
| 652 base::ThreadTaskRunnerHandle::Get()->PostTask( | 651 base::ThreadTaskRunnerHandle::Get()->PostTask( |
| (...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 767 } | 766 } |
| 768 | 767 |
| 769 ChromeWebUIControllerFactory::~ChromeWebUIControllerFactory() { | 768 ChromeWebUIControllerFactory::~ChromeWebUIControllerFactory() { |
| 770 } | 769 } |
| 771 | 770 |
| 772 base::RefCountedMemory* ChromeWebUIControllerFactory::GetFaviconResourceBytes( | 771 base::RefCountedMemory* ChromeWebUIControllerFactory::GetFaviconResourceBytes( |
| 773 const GURL& page_url, ui::ScaleFactor scale_factor) const { | 772 const GURL& page_url, ui::ScaleFactor scale_factor) const { |
| 774 #if !defined(OS_ANDROID) // Bookmarks are part of NTP on Android. | 773 #if !defined(OS_ANDROID) // Bookmarks are part of NTP on Android. |
| 775 // The bookmark manager is a chrome extension, so we have to check for it | 774 // The bookmark manager is a chrome extension, so we have to check for it |
| 776 // before we check for extension scheme. | 775 // before we check for extension scheme. |
| 777 if (page_url.host() == extension_misc::kBookmarkManagerId || | 776 if (page_url.host_piece() == extension_misc::kBookmarkManagerId || |
| 778 page_url.host() == chrome::kChromeUIBookmarksHost) { | 777 page_url.host_piece() == chrome::kChromeUIBookmarksHost) { |
| 779 return BookmarksUI::GetFaviconResourceBytes(scale_factor); | 778 return BookmarksUI::GetFaviconResourceBytes(scale_factor); |
| 780 } | 779 } |
| 781 | 780 |
| 782 // The extension scheme is handled in GetFaviconForURL. | 781 // The extension scheme is handled in GetFaviconForURL. |
| 783 if (page_url.SchemeIs(extensions::kExtensionScheme)) { | 782 if (page_url.SchemeIs(extensions::kExtensionScheme)) { |
| 784 NOTREACHED(); | 783 NOTREACHED(); |
| 785 return NULL; | 784 return NULL; |
| 786 } | 785 } |
| 787 #endif | 786 #endif |
| 788 | 787 |
| 789 if (!content::HasWebUIScheme(page_url)) | 788 if (!content::HasWebUIScheme(page_url)) |
| 790 return NULL; | 789 return NULL; |
| 791 | 790 |
| 792 if (page_url.host() == chrome::kChromeUIComponentsHost) | 791 if (page_url.host_piece() == chrome::kChromeUIComponentsHost) |
| 793 return ComponentsUI::GetFaviconResourceBytes(scale_factor); | 792 return ComponentsUI::GetFaviconResourceBytes(scale_factor); |
| 794 | 793 |
| 795 #if defined(OS_WIN) | 794 #if defined(OS_WIN) |
| 796 if (page_url.host() == chrome::kChromeUIConflictsHost) | 795 if (page_url.host_piece() == chrome::kChromeUIConflictsHost) |
| 797 return ConflictsUI::GetFaviconResourceBytes(scale_factor); | 796 return ConflictsUI::GetFaviconResourceBytes(scale_factor); |
| 798 #endif | 797 #endif |
| 799 | 798 |
| 800 if (page_url.host() == chrome::kChromeUICrashesHost) | 799 if (page_url.host_piece() == chrome::kChromeUICrashesHost) |
| 801 return CrashesUI::GetFaviconResourceBytes(scale_factor); | 800 return CrashesUI::GetFaviconResourceBytes(scale_factor); |
| 802 | 801 |
| 803 if (page_url.host() == chrome::kChromeUIFlagsHost) | 802 if (page_url.host_piece() == chrome::kChromeUIFlagsHost) |
| 804 return FlagsUI::GetFaviconResourceBytes(scale_factor); | 803 return FlagsUI::GetFaviconResourceBytes(scale_factor); |
| 805 | 804 |
| 806 if (page_url.host() == chrome::kChromeUIHistoryHost) | 805 if (page_url.host_piece() == chrome::kChromeUIHistoryHost) |
| 807 return HistoryUI::GetFaviconResourceBytes(scale_factor); | 806 return HistoryUI::GetFaviconResourceBytes(scale_factor); |
| 808 | 807 |
| 809 #if !defined(OS_ANDROID) | 808 #if !defined(OS_ANDROID) |
| 810 #if !defined(OS_CHROMEOS) | 809 #if !defined(OS_CHROMEOS) |
| 811 // The Apps launcher page is not available on android or ChromeOS. | 810 // The Apps launcher page is not available on android or ChromeOS. |
| 812 if (page_url.host() == chrome::kChromeUIAppLauncherPageHost) | 811 if (page_url.host_piece() == chrome::kChromeUIAppLauncherPageHost) |
| 813 return AppLauncherPageUI::GetFaviconResourceBytes(scale_factor); | 812 return AppLauncherPageUI::GetFaviconResourceBytes(scale_factor); |
| 814 #endif | 813 #endif |
| 815 | 814 |
| 816 // Flash is not available on android. | 815 // Flash is not available on android. |
| 817 if (page_url.host() == chrome::kChromeUIFlashHost) | 816 if (page_url.host_piece() == chrome::kChromeUIFlashHost) |
| 818 return FlashUI::GetFaviconResourceBytes(scale_factor); | 817 return FlashUI::GetFaviconResourceBytes(scale_factor); |
| 819 | 818 |
| 820 // Android uses the native download manager. | 819 // Android uses the native download manager. |
| 821 if (page_url.host() == chrome::kChromeUIDownloadsHost) | 820 if (page_url.host_piece() == chrome::kChromeUIDownloadsHost) |
| 822 return MdDownloadsUI::GetFaviconResourceBytes(scale_factor); | 821 return MdDownloadsUI::GetFaviconResourceBytes(scale_factor); |
| 823 | 822 |
| 824 // Android doesn't use the Options/Settings pages. | 823 // Android doesn't use the Options/Settings pages. |
| 825 if (page_url.host() == chrome::kChromeUISettingsHost || | 824 if (page_url.host_piece() == chrome::kChromeUISettingsHost || |
| 826 page_url.host() == chrome::kChromeUISettingsFrameHost || | 825 page_url.host_piece() == chrome::kChromeUISettingsFrameHost || |
| 827 page_url.host() == chrome::kChromeUIMdSettingsHost) | 826 page_url.host_piece() == chrome::kChromeUIMdSettingsHost) |
| 828 return settings_utils::GetFaviconResourceBytes(scale_factor); | 827 return settings_utils::GetFaviconResourceBytes(scale_factor); |
| 829 | 828 |
| 830 #if defined(ENABLE_EXTENSIONS) | 829 #if defined(ENABLE_EXTENSIONS) |
| 831 if (page_url.host() == chrome::kChromeUIExtensionsHost || | 830 if (page_url.host_piece() == chrome::kChromeUIExtensionsHost || |
| 832 page_url.host() == chrome::kChromeUIExtensionsFrameHost) | 831 page_url.host_piece() == chrome::kChromeUIExtensionsFrameHost) |
| 833 return extensions::ExtensionsUI::GetFaviconResourceBytes(scale_factor); | 832 return extensions::ExtensionsUI::GetFaviconResourceBytes(scale_factor); |
| 834 #endif | 833 #endif |
| 835 | 834 |
| 836 // Android doesn't use the plugins pages. | 835 // Android doesn't use the plugins pages. |
| 837 if (page_url.host() == chrome::kChromeUIPluginsHost) | 836 if (page_url.host_piece() == chrome::kChromeUIPluginsHost) |
| 838 return PluginsUI::GetFaviconResourceBytes(scale_factor); | 837 return PluginsUI::GetFaviconResourceBytes(scale_factor); |
| 839 | 838 |
| 840 #endif | 839 #endif |
| 841 | 840 |
| 842 return NULL; | 841 return NULL; |
| 843 } | 842 } |
| OLD | NEW |