OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 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/dom_distiller/profile_utils.h" | 5 #include "chrome/browser/dom_distiller/profile_utils.h" |
6 | 6 |
| 7 #include <utility> |
| 8 |
7 #include "base/command_line.h" | 9 #include "base/command_line.h" |
8 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
9 #include "chrome/browser/dom_distiller/dom_distiller_service_factory.h" | 11 #include "chrome/browser/dom_distiller/dom_distiller_service_factory.h" |
10 #include "chrome/browser/dom_distiller/lazy_dom_distiller_service.h" | 12 #include "chrome/browser/dom_distiller/lazy_dom_distiller_service.h" |
11 #include "chrome/browser/profiles/profile.h" | 13 #include "chrome/browser/profiles/profile.h" |
12 #include "chrome/common/chrome_isolated_world_ids.h" | 14 #include "chrome/common/chrome_isolated_world_ids.h" |
13 #include "chrome/common/chrome_switches.h" | 15 #include "chrome/common/chrome_switches.h" |
14 #include "chrome/common/features.h" | 16 #include "chrome/common/features.h" |
15 #include "components/dom_distiller/content/browser/distiller_javascript_utils.h" | 17 #include "components/dom_distiller/content/browser/distiller_javascript_utils.h" |
16 #include "components/dom_distiller/content/browser/distiller_ui_handle.h" | 18 #include "components/dom_distiller/content/browser/distiller_ui_handle.h" |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
48 new dom_distiller::android::DistillerUIHandleAndroid()); | 50 new dom_distiller::android::DistillerUIHandleAndroid()); |
49 #endif // BUILDFLAG(ANDROID_JAVA_UI) | 51 #endif // BUILDFLAG(ANDROID_JAVA_UI) |
50 | 52 |
51 // Set the JavaScript world ID. | 53 // Set the JavaScript world ID. |
52 if (!dom_distiller::DistillerJavaScriptWorldIdIsSet()) { | 54 if (!dom_distiller::DistillerJavaScriptWorldIdIsSet()) { |
53 dom_distiller::SetDistillerJavaScriptWorldId( | 55 dom_distiller::SetDistillerJavaScriptWorldId( |
54 chrome::ISOLATED_WORLD_ID_CHROME_INTERNAL); | 56 chrome::ISOLATED_WORLD_ID_CHROME_INTERNAL); |
55 } | 57 } |
56 | 58 |
57 content::URLDataSource::Add( | 59 content::URLDataSource::Add( |
58 profile, | 60 profile, new dom_distiller::DomDistillerViewerSource( |
59 new dom_distiller::DomDistillerViewerSource( | 61 lazy_service, dom_distiller::kDomDistillerScheme, |
60 lazy_service, dom_distiller::kDomDistillerScheme, | 62 std::move(ui_handle))); |
61 ui_handle.Pass())); | |
62 } | 63 } |
63 } | 64 } |
OLD | NEW |