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/core/page_distiller.h" | 5 #include "components/dom_distiller/core/page_distiller.h" |
6 | 6 |
7 #include <map> | 7 #include <map> |
8 | 8 |
9 #include "base/location.h" | 9 #include "base/location.h" |
10 #include "base/message_loop/message_loop.h" | 10 #include "base/message_loop/message_loop.h" |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
67 // The JavaScript returns an array where the first element is the title, | 67 // The JavaScript returns an array where the first element is the title, |
68 // the second element is the article content HTML, and the remaining | 68 // the second element is the article content HTML, and the remaining |
69 // elements are image URLs referenced in the HTML. | 69 // elements are image URLs referenced in the HTML. |
70 switch (i) { | 70 switch (i) { |
71 case 0: | 71 case 0: |
72 page_info->title = item; | 72 page_info->title = item; |
73 break; | 73 break; |
74 case 1: | 74 case 1: |
75 page_info->html = item; | 75 page_info->html = item; |
76 break; | 76 break; |
77 case 2: { | 77 case 2: |
78 page_info->next_page_url = item; | 78 page_info->next_page_url = item; |
79 break; | 79 break; |
80 } | 80 case 3: |
| 81 page_info->prev_page_url = item; |
| 82 break; |
81 default: | 83 default: |
82 page_info->image_urls.push_back(item); | 84 page_info->image_urls.push_back(item); |
83 } | 85 } |
84 } | 86 } |
85 base::MessageLoop::current()->PostTask( | 87 base::MessageLoop::current()->PostTask( |
86 FROM_HERE, | 88 FROM_HERE, |
87 base::Bind(page_distiller_callback_, base::Passed(&page_info), true)); | 89 base::Bind(page_distiller_callback_, base::Passed(&page_info), true)); |
88 } | 90 } |
89 } | 91 } |
90 | 92 |
91 } // namespace dom_distiller | 93 } // namespace dom_distiller |
OLD | NEW |