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

Side by Side Diff: chrome/browser/profiles/profile_impl.cc

Issue 608653002: Add support for using DOM Distiller in incognito. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 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/profiles/off_the_record_profile_impl.cc ('k') | chrome/chrome_browser.gypi » ('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/profiles/profile_impl.h" 5 #include "chrome/browser/profiles/profile_impl.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/callback.h" 10 #include "base/callback.h"
(...skipping 16 matching lines...) Expand all
27 #include "base/version.h" 27 #include "base/version.h"
28 #include "chrome/browser/autocomplete/autocomplete_classifier.h" 28 #include "chrome/browser/autocomplete/autocomplete_classifier.h"
29 #include "chrome/browser/autocomplete/shortcuts_backend.h" 29 #include "chrome/browser/autocomplete/shortcuts_backend.h"
30 #include "chrome/browser/background/background_contents_service_factory.h" 30 #include "chrome/browser/background/background_contents_service_factory.h"
31 #include "chrome/browser/background/background_mode_manager.h" 31 #include "chrome/browser/background/background_mode_manager.h"
32 #include "chrome/browser/bookmarks/bookmark_model_factory.h" 32 #include "chrome/browser/bookmarks/bookmark_model_factory.h"
33 #include "chrome/browser/browser_process.h" 33 #include "chrome/browser/browser_process.h"
34 #include "chrome/browser/chrome_notification_types.h" 34 #include "chrome/browser/chrome_notification_types.h"
35 #include "chrome/browser/content_settings/cookie_settings.h" 35 #include "chrome/browser/content_settings/cookie_settings.h"
36 #include "chrome/browser/content_settings/host_content_settings_map.h" 36 #include "chrome/browser/content_settings/host_content_settings_map.h"
37 #include "chrome/browser/dom_distiller/dom_distiller_service_factory.h" 37 #include "chrome/browser/dom_distiller/profile_utils.h"
38 #include "chrome/browser/dom_distiller/lazy_dom_distiller_service.h"
39 #include "chrome/browser/domain_reliability/service_factory.h" 38 #include "chrome/browser/domain_reliability/service_factory.h"
40 #include "chrome/browser/download/chrome_download_manager_delegate.h" 39 #include "chrome/browser/download/chrome_download_manager_delegate.h"
41 #include "chrome/browser/download/download_service.h" 40 #include "chrome/browser/download/download_service.h"
42 #include "chrome/browser/download/download_service_factory.h" 41 #include "chrome/browser/download/download_service_factory.h"
43 #include "chrome/browser/history/top_sites.h" 42 #include "chrome/browser/history/top_sites.h"
44 #include "chrome/browser/net/net_pref_observer.h" 43 #include "chrome/browser/net/net_pref_observer.h"
45 #include "chrome/browser/net/predictor.h" 44 #include "chrome/browser/net/predictor.h"
46 #include "chrome/browser/net/pref_proxy_config_tracker.h" 45 #include "chrome/browser/net/pref_proxy_config_tracker.h"
47 #include "chrome/browser/net/proxy_service_factory.h" 46 #include "chrome/browser/net/proxy_service_factory.h"
48 #include "chrome/browser/net/spdyproxy/data_reduction_proxy_chrome_configurator. h" 47 #include "chrome/browser/net/spdyproxy/data_reduction_proxy_chrome_configurator. h"
(...skipping 29 matching lines...) Expand all
78 #include "chrome/common/chrome_paths_internal.h" 77 #include "chrome/common/chrome_paths_internal.h"
79 #include "chrome/common/chrome_switches.h" 78 #include "chrome/common/chrome_switches.h"
80 #include "chrome/common/chrome_version_info.h" 79 #include "chrome/common/chrome_version_info.h"
81 #include "chrome/common/pref_names.h" 80 #include "chrome/common/pref_names.h"
82 #include "chrome/common/url_constants.h" 81 #include "chrome/common/url_constants.h"
83 #include "chrome/grit/chromium_strings.h" 82 #include "chrome/grit/chromium_strings.h"
84 #include "components/bookmarks/browser/bookmark_model.h" 83 #include "components/bookmarks/browser/bookmark_model.h"
85 #include "components/data_reduction_proxy/browser/data_reduction_proxy_params.h" 84 #include "components/data_reduction_proxy/browser/data_reduction_proxy_params.h"
86 #include "components/data_reduction_proxy/browser/data_reduction_proxy_settings. h" 85 #include "components/data_reduction_proxy/browser/data_reduction_proxy_settings. h"
87 #include "components/data_reduction_proxy/browser/data_reduction_proxy_statistic s_prefs.h" 86 #include "components/data_reduction_proxy/browser/data_reduction_proxy_statistic s_prefs.h"
88 #include "components/dom_distiller/content/dom_distiller_viewer_source.h"
89 #include "components/dom_distiller/core/url_constants.h"
90 #include "components/domain_reliability/monitor.h" 87 #include "components/domain_reliability/monitor.h"
91 #include "components/domain_reliability/service.h" 88 #include "components/domain_reliability/service.h"
92 #include "components/keyed_service/content/browser_context_dependency_manager.h" 89 #include "components/keyed_service/content/browser_context_dependency_manager.h"
93 #include "components/metrics/metrics_service.h" 90 #include "components/metrics/metrics_service.h"
94 #include "components/pref_registry/pref_registry_syncable.h" 91 #include "components/pref_registry/pref_registry_syncable.h"
95 #include "components/startup_metric_utils/startup_metric_utils.h" 92 #include "components/startup_metric_utils/startup_metric_utils.h"
96 #include "components/url_fixer/url_fixer.h" 93 #include "components/url_fixer/url_fixer.h"
97 #include "components/user_prefs/user_prefs.h" 94 #include "components/user_prefs/user_prefs.h"
98 #include "content/public/browser/browser_thread.h" 95 #include "content/public/browser/browser_thread.h"
99 #include "content/public/browser/dom_storage_context.h" 96 #include "content/public/browser/dom_storage_context.h"
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after
244 return ProfileImpl::kPrefExitTypeNormal; 241 return ProfileImpl::kPrefExitTypeNormal;
245 case Profile::EXIT_SESSION_ENDED: 242 case Profile::EXIT_SESSION_ENDED:
246 return kPrefExitTypeSessionEnded; 243 return kPrefExitTypeSessionEnded;
247 case Profile::EXIT_CRASHED: 244 case Profile::EXIT_CRASHED:
248 return kPrefExitTypeCrashed; 245 return kPrefExitTypeCrashed;
249 } 246 }
250 NOTREACHED(); 247 NOTREACHED();
251 return std::string(); 248 return std::string();
252 } 249 }
253 250
254 // Setup URLDataSource for the chrome-distiller:// scheme for the given
255 // |profile|.
256 void RegisterDomDistillerViewerSource(Profile* profile) {
257 const CommandLine& command_line = *CommandLine::ForCurrentProcess();
258 if (command_line.HasSwitch(switches::kEnableDomDistiller)) {
259 dom_distiller::DomDistillerServiceFactory* dom_distiller_service_factory =
260 dom_distiller::DomDistillerServiceFactory::GetInstance();
261 // The LazyDomDistillerService deletes itself when the profile is destroyed.
262 dom_distiller::LazyDomDistillerService* lazy_service =
263 new dom_distiller::LazyDomDistillerService(
264 profile, dom_distiller_service_factory);
265 content::URLDataSource::Add(
266 profile,
267 new dom_distiller::DomDistillerViewerSource(
268 lazy_service, dom_distiller::kDomDistillerScheme));
269 }
270 }
271
272 PrefStore* CreateExtensionPrefStore(Profile* profile, 251 PrefStore* CreateExtensionPrefStore(Profile* profile,
273 bool incognito_pref_store) { 252 bool incognito_pref_store) {
274 #if defined(ENABLE_EXTENSIONS) 253 #if defined(ENABLE_EXTENSIONS)
275 return new ExtensionPrefStore( 254 return new ExtensionPrefStore(
276 ExtensionPrefValueMapFactory::GetForBrowserContext(profile), 255 ExtensionPrefValueMapFactory::GetForBrowserContext(profile),
277 incognito_pref_store); 256 incognito_pref_store);
278 #else 257 #else
279 return NULL; 258 return NULL;
280 #endif 259 #endif
281 } 260 }
(...skipping 1166 matching lines...) Expand 10 before | Expand all | Expand 10 after
1448 domain_reliability::DomainReliabilityServiceFactory::GetInstance()-> 1427 domain_reliability::DomainReliabilityServiceFactory::GetInstance()->
1449 GetForBrowserContext(this); 1428 GetForBrowserContext(this);
1450 if (!service) 1429 if (!service)
1451 return scoped_ptr<domain_reliability::DomainReliabilityMonitor>(); 1430 return scoped_ptr<domain_reliability::DomainReliabilityMonitor>();
1452 1431
1453 return service->CreateMonitor( 1432 return service->CreateMonitor(
1454 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO), 1433 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO),
1455 local_state, 1434 local_state,
1456 prefs::kMetricsReportingEnabled); 1435 prefs::kMetricsReportingEnabled);
1457 } 1436 }
OLDNEW
« no previous file with comments | « chrome/browser/profiles/off_the_record_profile_impl.cc ('k') | chrome/chrome_browser.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698