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 "components/dom_distiller/content/dom_distiller_viewer_source.h" | 5 #include "components/dom_distiller/content/dom_distiller_viewer_source.h" |
6 | 6 |
7 #include <sstream> | 7 #include <sstream> |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
11 #include "base/memory/ref_counted_memory.h" | 11 #include "base/memory/ref_counted_memory.h" |
12 #include "base/memory/scoped_ptr.h" | 12 #include "base/memory/scoped_ptr.h" |
13 #include "base/message_loop/message_loop.h" | 13 #include "base/message_loop/message_loop.h" |
14 #include "base/strings/utf_string_conversions.h" | 14 #include "base/strings/utf_string_conversions.h" |
15 #include "components/dom_distiller/core/distilled_page_prefs.h" | 15 #include "components/dom_distiller/core/distilled_page_prefs.h" |
16 #include "components/dom_distiller/core/dom_distiller_service.h" | 16 #include "components/dom_distiller/core/dom_distiller_service.h" |
17 #include "components/dom_distiller/core/task_tracker.h" | 17 #include "components/dom_distiller/core/task_tracker.h" |
18 #include "components/dom_distiller/core/url_constants.h" | 18 #include "components/dom_distiller/core/url_constants.h" |
19 #include "components/dom_distiller/core/viewer.h" | 19 #include "components/dom_distiller/core/viewer.h" |
20 #include "content/public/browser/navigation_details.h" | 20 #include "content/public/browser/navigation_details.h" |
21 #include "content/public/browser/navigation_entry.h" | 21 #include "content/public/browser/navigation_entry.h" |
22 #include "content/public/browser/render_frame_host.h" | 22 #include "content/public/browser/render_frame_host.h" |
23 #include "content/public/browser/render_view_host.h" | 23 #include "content/public/browser/render_view_host.h" |
24 #include "content/public/browser/web_contents.h" | 24 #include "content/public/browser/web_contents.h" |
25 #include "content/public/browser/web_contents_observer.h" | 25 #include "content/public/browser/web_contents_observer.h" |
26 #include "net/base/url_util.h" | 26 #include "net/base/url_util.h" |
27 #include "net/url_request/url_request.h" | 27 #include "net/url_request/url_request.h" |
28 // Copyright 2014 The Chromium Authors. All rights reserved. | |
nyquist
2014/07/09 23:49:04
I don't understand this diff.
sunangel
2014/07/10 14:31:53
Neither do I. Base is incorrect, fixed.
On 2014/0
| |
29 // Use of this source code is governed by a BSD-style license that can be | |
30 // found in the LICENSE file. | |
31 | |
32 #include "components/dom_distiller/content/dom_distiller_viewer_source.h" | |
33 | |
34 #include <sstream> | |
35 #include <string> | |
36 #include <vector> | |
37 | |
38 #include "base/memory/ref_counted_memory.h" | |
39 #include "base/memory/scoped_ptr.h" | |
40 #include "base/message_loop/message_loop.h" | |
41 #include "base/strings/utf_string_conversions.h" | |
42 #include "components/dom_distiller/core/distilled_page_prefs.h" | |
43 #include "components/dom_distiller/core/dom_distiller_service.h" | |
44 #include "components/dom_distiller/core/task_tracker.h" | |
45 #include "components/dom_distiller/core/url_constants.h" | |
46 #include "components/dom_distiller/core/viewer.h" | |
47 #include "content/public/browser/navigation_details.h" | |
48 #include "content/public/browser/navigation_entry.h" | |
49 #include "content/public/browser/render_frame_host.h" | |
50 #include "content/public/browser/render_view_host.h" | |
51 #include "content/public/browser/web_contents.h" | |
52 #include "content/public/browser/web_contents_observer.h" | |
53 #include "net/base/url_util.h" | |
54 #include "net/url_request/url_request.h" | |
55 | 28 |
56 namespace dom_distiller { | 29 namespace dom_distiller { |
57 | 30 |
58 // Handles receiving data asynchronously for a specific entry, and passing | 31 // Handles receiving data asynchronously for a specific entry, and passing |
59 // it along to the data callback for the data source. Lifetime matches that of | 32 // it along to the data callback for the data source. Lifetime matches that of |
60 // the current main frame's page in the Viewer instance. | 33 // the current main frame's page in the Viewer instance. |
61 class DomDistillerViewerSource::RequestViewerHandle | 34 class DomDistillerViewerSource::RequestViewerHandle |
62 : public ViewRequestDelegate, | 35 : public ViewRequestDelegate, |
63 public content::WebContentsObserver, | 36 public content::WebContentsObserver, |
64 public DistilledPagePrefs::Observer { | 37 public DistilledPagePrefs::Observer { |
(...skipping 304 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
369 const net::URLRequest* request, | 342 const net::URLRequest* request, |
370 std::string* path) const { | 343 std::string* path) const { |
371 } | 344 } |
372 | 345 |
373 std::string DomDistillerViewerSource::GetContentSecurityPolicyObjectSrc() | 346 std::string DomDistillerViewerSource::GetContentSecurityPolicyObjectSrc() |
374 const { | 347 const { |
375 return "object-src 'none'; style-src 'self';"; | 348 return "object-src 'none'; style-src 'self';"; |
376 } | 349 } |
377 | 350 |
378 } // namespace dom_distiller | 351 } // namespace dom_distiller |
OLD | NEW |