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

Side by Side Diff: chrome/browser/dom_distiller/profile_utils.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
OLDNEW
(Empty)
1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "chrome/browser/dom_distiller/profile_utils.h"
6
7 #include "base/command_line.h"
8 #include "chrome/browser/dom_distiller/dom_distiller_service_factory.h"
9 #include "chrome/browser/dom_distiller/lazy_dom_distiller_service.h"
10 #include "chrome/browser/profiles/profile.h"
11 #include "chrome/common/chrome_switches.h"
12 #include "components/dom_distiller/content/dom_distiller_viewer_source.h"
13 #include "components/dom_distiller/core/url_constants.h"
14
15 void RegisterDomDistillerViewerSource(Profile* profile) {
16 const CommandLine& command_line = *CommandLine::ForCurrentProcess();
17 if (command_line.HasSwitch(switches::kEnableDomDistiller)) {
18 dom_distiller::DomDistillerServiceFactory* dom_distiller_service_factory =
19 dom_distiller::DomDistillerServiceFactory::GetInstance();
20 // The LazyDomDistillerService deletes itself when the profile is destroyed.
21 dom_distiller::LazyDomDistillerService* lazy_service =
22 new dom_distiller::LazyDomDistillerService(
23 profile, dom_distiller_service_factory);
24 content::URLDataSource::Add(
25 profile,
26 new dom_distiller::DomDistillerViewerSource(
27 lazy_service, dom_distiller::kDomDistillerScheme));
28 }
29 }
OLDNEW
« no previous file with comments | « chrome/browser/dom_distiller/profile_utils.h ('k') | chrome/browser/profiles/off_the_record_profile_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698