| 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 "components/dom_distiller/core/distiller_page.h" | 5 #include "components/dom_distiller/core/distiller_page.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "url/gurl.h" | 8 #include "url/gurl.h" |
| 9 | 9 |
| 10 namespace dom_distiller { | 10 namespace dom_distiller { |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 45 if (!delegate_) | 45 if (!delegate_) |
| 46 return; | 46 return; |
| 47 delegate_->OnLoadURLDone(); | 47 delegate_->OnLoadURLDone(); |
| 48 } | 48 } |
| 49 | 49 |
| 50 void DistillerPage::OnLoadURLFailed() { | 50 void DistillerPage::OnLoadURLFailed() { |
| 51 state_ = PAGELOAD_FAILED; | 51 state_ = PAGELOAD_FAILED; |
| 52 scoped_ptr<base::Value> empty(base::Value::CreateNullValue()); | 52 scoped_ptr<base::Value> empty(base::Value::CreateNullValue()); |
| 53 if (!delegate_) | 53 if (!delegate_) |
| 54 return; | 54 return; |
| 55 delegate_->OnExecuteJavaScriptDone(empty.get()); | 55 delegate_->OnExecuteJavaScriptDone(GURL(), empty.get()); |
| 56 } | 56 } |
| 57 | 57 |
| 58 void DistillerPage::OnExecuteJavaScriptDone( | 58 void DistillerPage::OnExecuteJavaScriptDone(const GURL& page_url, |
| 59 const base::Value* value) { | 59 const base::Value* value) { |
| 60 DCHECK_EQ(EXECUTING_JAVASCRIPT, state_); | 60 DCHECK_EQ(EXECUTING_JAVASCRIPT, state_); |
| 61 state_ = PAGE_AVAILABLE; | 61 state_ = PAGE_AVAILABLE; |
| 62 if (!delegate_) | 62 if (!delegate_) |
| 63 return; | 63 return; |
| 64 delegate_->OnExecuteJavaScriptDone(value); | 64 delegate_->OnExecuteJavaScriptDone(page_url, value); |
| 65 } | 65 } |
| 66 | 66 |
| 67 } // namespace dom_distiller | 67 } // namespace dom_distiller |
| OLD | NEW |