OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/prerender/prerender_contents.h" | 5 #include "chrome/browser/prerender/prerender_contents.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <functional> | 8 #include <functional> |
9 #include <utility> | 9 #include <utility> |
10 | 10 |
(...skipping 684 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
695 } | 695 } |
696 | 696 |
697 Value* PrerenderContents::GetAsValue() const { | 697 Value* PrerenderContents::GetAsValue() const { |
698 if (!prerender_contents_.get()) | 698 if (!prerender_contents_.get()) |
699 return NULL; | 699 return NULL; |
700 DictionaryValue* dict_value = new DictionaryValue(); | 700 DictionaryValue* dict_value = new DictionaryValue(); |
701 dict_value->SetString("url", prerender_url_.spec()); | 701 dict_value->SetString("url", prerender_url_.spec()); |
702 base::TimeTicks current_time = base::TimeTicks::Now(); | 702 base::TimeTicks current_time = base::TimeTicks::Now(); |
703 base::TimeDelta duration = current_time - load_start_time_; | 703 base::TimeDelta duration = current_time - load_start_time_; |
704 dict_value->SetInteger("duration", duration.InSeconds()); | 704 dict_value->SetInteger("duration", duration.InSeconds()); |
| 705 dict_value->SetBoolean("is_loaded", prerender_contents_ && |
| 706 !prerender_contents_->IsLoading()); |
705 return dict_value; | 707 return dict_value; |
706 } | 708 } |
707 | 709 |
708 bool PrerenderContents::IsCrossSiteNavigationPending() const { | 710 bool PrerenderContents::IsCrossSiteNavigationPending() const { |
709 if (!prerender_contents_) | 711 if (!prerender_contents_) |
710 return false; | 712 return false; |
711 return (prerender_contents_->GetSiteInstance() != | 713 return (prerender_contents_->GetSiteInstance() != |
712 prerender_contents_->GetPendingSiteInstance()); | 714 prerender_contents_->GetPendingSiteInstance()); |
713 } | 715 } |
714 | 716 |
715 | 717 |
716 } // namespace prerender | 718 } // namespace prerender |
OLD | NEW |