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

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

Issue 1316043003: Add chrome://site-engagement WebUI. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@navigation_smarter
Patch Set: fix dependencies Created 5 years, 3 months 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
« no previous file with comments | « chrome/browser/ui/BUILD.gn ('k') | chrome/browser/ui/webui/engagement/BUILD.gn » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 <vector> 7 #include <vector>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/command_line.h" 10 #include "base/command_line.h"
11 #include "base/location.h" 11 #include "base/location.h"
12 #include "base/prefs/pref_service.h" 12 #include "base/prefs/pref_service.h"
13 #include "base/thread_task_runner_handle.h" 13 #include "base/thread_task_runner_handle.h"
14 #include "chrome/browser/about_flags.h" 14 #include "chrome/browser/about_flags.h"
15 #include "chrome/browser/dom_distiller/dom_distiller_service_factory.h" 15 #include "chrome/browser/dom_distiller/dom_distiller_service_factory.h"
16 #include "chrome/browser/engagement/site_engagement_service.h"
16 #include "chrome/browser/profiles/profile.h" 17 #include "chrome/browser/profiles/profile.h"
17 #include "chrome/browser/profiles/profile_manager.h" 18 #include "chrome/browser/profiles/profile_manager.h"
18 #include "chrome/browser/ui/webui/about_ui.h" 19 #include "chrome/browser/ui/webui/about_ui.h"
19 #include "chrome/browser/ui/webui/bookmarks_ui.h" 20 #include "chrome/browser/ui/webui/bookmarks_ui.h"
20 #include "chrome/browser/ui/webui/components_ui.h" 21 #include "chrome/browser/ui/webui/components_ui.h"
21 #include "chrome/browser/ui/webui/constrained_web_dialog_ui.h" 22 #include "chrome/browser/ui/webui/constrained_web_dialog_ui.h"
22 #include "chrome/browser/ui/webui/crashes_ui.h" 23 #include "chrome/browser/ui/webui/crashes_ui.h"
23 #include "chrome/browser/ui/webui/device_log_ui.h" 24 #include "chrome/browser/ui/webui/device_log_ui.h"
24 #include "chrome/browser/ui/webui/domain_reliability_internals_ui.h" 25 #include "chrome/browser/ui/webui/domain_reliability_internals_ui.h"
25 #include "chrome/browser/ui/webui/downloads_ui.h" 26 #include "chrome/browser/ui/webui/downloads_ui.h"
27 #include "chrome/browser/ui/webui/engagement/site_engagement_ui.h"
26 #include "chrome/browser/ui/webui/flags_ui.h" 28 #include "chrome/browser/ui/webui/flags_ui.h"
27 #include "chrome/browser/ui/webui/flash_ui.h" 29 #include "chrome/browser/ui/webui/flash_ui.h"
28 #include "chrome/browser/ui/webui/gcm_internals_ui.h" 30 #include "chrome/browser/ui/webui/gcm_internals_ui.h"
29 #include "chrome/browser/ui/webui/help/help_ui.h" 31 #include "chrome/browser/ui/webui/help/help_ui.h"
30 #include "chrome/browser/ui/webui/history_ui.h" 32 #include "chrome/browser/ui/webui/history_ui.h"
31 #include "chrome/browser/ui/webui/identity_internals_ui.h" 33 #include "chrome/browser/ui/webui/identity_internals_ui.h"
32 #include "chrome/browser/ui/webui/instant_ui.h" 34 #include "chrome/browser/ui/webui/instant_ui.h"
33 #include "chrome/browser/ui/webui/interstitials/interstitial_ui.h" 35 #include "chrome/browser/ui/webui/interstitials/interstitial_ui.h"
34 #include "chrome/browser/ui/webui/invalidations_ui.h" 36 #include "chrome/browser/ui/webui/invalidations_ui.h"
35 #include "chrome/browser/ui/webui/local_state/local_state_ui.h" 37 #include "chrome/browser/ui/webui/local_state/local_state_ui.h"
(...skipping 539 matching lines...) Expand 10 before | Expand all | Expand 10 after
575 } 577 }
576 #endif 578 #endif
577 if (IsAboutUI(url)) 579 if (IsAboutUI(url))
578 return &NewWebUI<AboutUI>; 580 return &NewWebUI<AboutUI>;
579 581
580 if (dom_distiller::IsEnableDomDistillerSet() && 582 if (dom_distiller::IsEnableDomDistillerSet() &&
581 url.host() == dom_distiller::kChromeUIDomDistillerHost) { 583 url.host() == dom_distiller::kChromeUIDomDistillerHost) {
582 return &NewWebUI<dom_distiller::DomDistillerUi>; 584 return &NewWebUI<dom_distiller::DomDistillerUi>;
583 } 585 }
584 586
587 if (SiteEngagementService::IsEnabled() &&
588 url.host() == chrome::kChromeUISiteEngagementHost) {
589 return &NewWebUI<SiteEngagementUI>;
590 }
591
585 return NULL; 592 return NULL;
586 } 593 }
587 594
588 void RunFaviconCallbackAsync( 595 void RunFaviconCallbackAsync(
589 const favicon_base::FaviconResultsCallback& callback, 596 const favicon_base::FaviconResultsCallback& callback,
590 const std::vector<favicon_base::FaviconRawBitmapResult>* results) { 597 const std::vector<favicon_base::FaviconRawBitmapResult>* results) {
591 base::ThreadTaskRunnerHandle::Get()->PostTask( 598 base::ThreadTaskRunnerHandle::Get()->PostTask(
592 FROM_HERE, 599 FROM_HERE,
593 base::Bind(&favicon::FaviconService::FaviconResultsCallbackRunner, 600 base::Bind(&favicon::FaviconService::FaviconResultsCallbackRunner,
594 callback, base::Owned(results))); 601 callback, base::Owned(results)));
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after
768 #endif 775 #endif
769 776
770 // Android doesn't use the plugins pages. 777 // Android doesn't use the plugins pages.
771 if (page_url.host() == chrome::kChromeUIPluginsHost) 778 if (page_url.host() == chrome::kChromeUIPluginsHost)
772 return PluginsUI::GetFaviconResourceBytes(scale_factor); 779 return PluginsUI::GetFaviconResourceBytes(scale_factor);
773 780
774 #endif 781 #endif
775 782
776 return NULL; 783 return NULL;
777 } 784 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/BUILD.gn ('k') | chrome/browser/ui/webui/engagement/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698