| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "base/memory/weak_ptr.h" | 5 #include "base/memory/weak_ptr.h" |
| 6 #include "base/path_service.h" | 6 #include "base/path_service.h" |
| 7 #include "base/run_loop.h" | 7 #include "base/run_loop.h" |
| 8 #include "base/values.h" | 8 #include "base/values.h" |
| 9 #include "components/dom_distiller/content/distiller_page_web_contents.h" | 9 #include "components/dom_distiller/content/distiller_page_web_contents.h" |
| 10 #include "components/dom_distiller/content/web_contents_main_frame_observer.h" | 10 #include "components/dom_distiller/content/web_contents_main_frame_observer.h" |
| (...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 133 WebContentsMainFrameHelper(content::WebContents* web_contents, | 133 WebContentsMainFrameHelper(content::WebContents* web_contents, |
| 134 const base::Closure& callback, | 134 const base::Closure& callback, |
| 135 bool wait_for_document_loaded) | 135 bool wait_for_document_loaded) |
| 136 : WebContentsObserver(web_contents), | 136 : WebContentsObserver(web_contents), |
| 137 callback_(callback), | 137 callback_(callback), |
| 138 wait_for_document_loaded_(wait_for_document_loaded) {} | 138 wait_for_document_loaded_(wait_for_document_loaded) {} |
| 139 | 139 |
| 140 virtual void DidCommitProvisionalLoadForFrame( | 140 virtual void DidCommitProvisionalLoadForFrame( |
| 141 content::RenderFrameHost* render_frame_host, | 141 content::RenderFrameHost* render_frame_host, |
| 142 const GURL& url, | 142 const GURL& url, |
| 143 bool url_is_unreachable, |
| 143 ui::PageTransition transition_type) OVERRIDE { | 144 ui::PageTransition transition_type) OVERRIDE { |
| 144 if (wait_for_document_loaded_) | 145 if (wait_for_document_loaded_) |
| 145 return; | 146 return; |
| 146 if (!render_frame_host->GetParent()) | 147 if (!render_frame_host->GetParent()) |
| 147 callback_.Run(); | 148 callback_.Run(); |
| 148 } | 149 } |
| 149 | 150 |
| 150 virtual void DocumentLoadedInFrame( | 151 virtual void DocumentLoadedInFrame( |
| 151 content::RenderFrameHost* render_frame_host) OVERRIDE { | 152 content::RenderFrameHost* render_frame_host) OVERRIDE { |
| 152 if (wait_for_document_loaded_) { | 153 if (wait_for_document_loaded_) { |
| (...skipping 248 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 401 const proto::MarkupImage markup_image2 = markup_info.images(1); | 402 const proto::MarkupImage markup_image2 = markup_info.images(1); |
| 402 EXPECT_EQ("http://test/markup2.gif", markup_image2.url()); | 403 EXPECT_EQ("http://test/markup2.gif", markup_image2.url()); |
| 403 EXPECT_EQ("https://test/markup2.gif", markup_image2.secure_url()); | 404 EXPECT_EQ("https://test/markup2.gif", markup_image2.secure_url()); |
| 404 EXPECT_EQ("gif", markup_image2.type()); | 405 EXPECT_EQ("gif", markup_image2.type()); |
| 405 EXPECT_EQ("", markup_image2.caption()); | 406 EXPECT_EQ("", markup_image2.caption()); |
| 406 EXPECT_EQ(1000, markup_image2.width()); | 407 EXPECT_EQ(1000, markup_image2.width()); |
| 407 EXPECT_EQ(600, markup_image2.height()); | 408 EXPECT_EQ(600, markup_image2.height()); |
| 408 } | 409 } |
| 409 | 410 |
| 410 } // namespace dom_distiller | 411 } // namespace dom_distiller |
| OLD | NEW |