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 "content/browser/frame_host/navigation_entry_impl.h" | 5 #include "content/browser/frame_host/navigation_entry_impl.h" |
6 | 6 |
7 #include "base/metrics/histogram.h" | 7 #include "base/metrics/histogram.h" |
8 #include "base/strings/string_util.h" | 8 #include "base/strings/string_util.h" |
9 #include "base/strings/utf_string_conversions.h" | 9 #include "base/strings/utf_string_conversions.h" |
10 #include "content/public/common/content_constants.h" | 10 #include "content/public/common/content_constants.h" |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
46 transition_type_(PAGE_TRANSITION_LINK), | 46 transition_type_(PAGE_TRANSITION_LINK), |
47 has_post_data_(false), | 47 has_post_data_(false), |
48 post_id_(-1), | 48 post_id_(-1), |
49 restore_type_(RESTORE_NONE), | 49 restore_type_(RESTORE_NONE), |
50 is_overriding_user_agent_(false), | 50 is_overriding_user_agent_(false), |
51 http_status_code_(0), | 51 http_status_code_(0), |
52 is_renderer_initiated_(false), | 52 is_renderer_initiated_(false), |
53 should_replace_entry_(false), | 53 should_replace_entry_(false), |
54 should_clear_history_list_(false), | 54 should_clear_history_list_(false), |
55 can_load_local_resources_(false), | 55 can_load_local_resources_(false), |
56 frame_tree_node_id_(-1) { | 56 frame_tree_node_id_(-1), |
| 57 is_transition_navigation_(false) { |
57 } | 58 } |
58 | 59 |
59 NavigationEntryImpl::NavigationEntryImpl(SiteInstanceImpl* instance, | 60 NavigationEntryImpl::NavigationEntryImpl(SiteInstanceImpl* instance, |
60 int page_id, | 61 int page_id, |
61 const GURL& url, | 62 const GURL& url, |
62 const Referrer& referrer, | 63 const Referrer& referrer, |
63 const base::string16& title, | 64 const base::string16& title, |
64 PageTransition transition_type, | 65 PageTransition transition_type, |
65 bool is_renderer_initiated) | 66 bool is_renderer_initiated) |
66 : unique_id_(GetUniqueIDInConstructor()), | 67 : unique_id_(GetUniqueIDInConstructor()), |
67 site_instance_(instance), | 68 site_instance_(instance), |
68 bindings_(kInvalidBindings), | 69 bindings_(kInvalidBindings), |
69 page_type_(PAGE_TYPE_NORMAL), | 70 page_type_(PAGE_TYPE_NORMAL), |
70 url_(url), | 71 url_(url), |
71 referrer_(referrer), | 72 referrer_(referrer), |
72 update_virtual_url_with_url_(false), | 73 update_virtual_url_with_url_(false), |
73 title_(title), | 74 title_(title), |
74 page_id_(page_id), | 75 page_id_(page_id), |
75 transition_type_(transition_type), | 76 transition_type_(transition_type), |
76 has_post_data_(false), | 77 has_post_data_(false), |
77 post_id_(-1), | 78 post_id_(-1), |
78 restore_type_(RESTORE_NONE), | 79 restore_type_(RESTORE_NONE), |
79 is_overriding_user_agent_(false), | 80 is_overriding_user_agent_(false), |
80 http_status_code_(0), | 81 http_status_code_(0), |
81 is_renderer_initiated_(is_renderer_initiated), | 82 is_renderer_initiated_(is_renderer_initiated), |
82 should_replace_entry_(false), | 83 should_replace_entry_(false), |
83 should_clear_history_list_(false), | 84 should_clear_history_list_(false), |
84 can_load_local_resources_(false), | 85 can_load_local_resources_(false), |
85 frame_tree_node_id_(-1) { | 86 frame_tree_node_id_(-1), |
| 87 is_transition_navigation_(false) { |
86 } | 88 } |
87 | 89 |
88 NavigationEntryImpl::~NavigationEntryImpl() { | 90 NavigationEntryImpl::~NavigationEntryImpl() { |
89 } | 91 } |
90 | 92 |
91 int NavigationEntryImpl::GetUniqueID() const { | 93 int NavigationEntryImpl::GetUniqueID() const { |
92 return unique_id_; | 94 return unique_id_; |
93 } | 95 } |
94 | 96 |
95 PageType NavigationEntryImpl::GetPageType() const { | 97 PageType NavigationEntryImpl::GetPageType() const { |
(...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
295 } | 297 } |
296 | 298 |
297 const std::vector<GURL>& NavigationEntryImpl::GetRedirectChain() const { | 299 const std::vector<GURL>& NavigationEntryImpl::GetRedirectChain() const { |
298 return redirect_chain_; | 300 return redirect_chain_; |
299 } | 301 } |
300 | 302 |
301 bool NavigationEntryImpl::IsRestored() const { | 303 bool NavigationEntryImpl::IsRestored() const { |
302 return restore_type_ != RESTORE_NONE; | 304 return restore_type_ != RESTORE_NONE; |
303 } | 305 } |
304 | 306 |
| 307 void NavigationEntryImpl::SetIsTransitionNavigation( |
| 308 bool is_transition_navigation) { |
| 309 is_transition_navigation_ = is_transition_navigation; |
| 310 } |
| 311 |
| 312 bool NavigationEntryImpl::IsTransitionNavigation() { |
| 313 return is_transition_navigation_; |
| 314 } |
| 315 |
305 void NavigationEntryImpl::SetCanLoadLocalResources(bool allow) { | 316 void NavigationEntryImpl::SetCanLoadLocalResources(bool allow) { |
306 can_load_local_resources_ = allow; | 317 can_load_local_resources_ = allow; |
307 } | 318 } |
308 | 319 |
309 bool NavigationEntryImpl::GetCanLoadLocalResources() const { | 320 bool NavigationEntryImpl::GetCanLoadLocalResources() const { |
310 return can_load_local_resources_; | 321 return can_load_local_resources_; |
311 } | 322 } |
312 | 323 |
313 void NavigationEntryImpl::SetFrameToNavigate(const std::string& frame_name) { | 324 void NavigationEntryImpl::SetFrameToNavigate(const std::string& frame_name) { |
314 frame_to_navigate_ = frame_name; | 325 frame_to_navigate_ = frame_name; |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
350 } | 361 } |
351 | 362 |
352 void NavigationEntryImpl::SetScreenshotPNGData( | 363 void NavigationEntryImpl::SetScreenshotPNGData( |
353 scoped_refptr<base::RefCountedBytes> png_data) { | 364 scoped_refptr<base::RefCountedBytes> png_data) { |
354 screenshot_ = png_data; | 365 screenshot_ = png_data; |
355 if (screenshot_.get()) | 366 if (screenshot_.get()) |
356 UMA_HISTOGRAM_MEMORY_KB("Overscroll.ScreenshotSize", screenshot_->size()); | 367 UMA_HISTOGRAM_MEMORY_KB("Overscroll.ScreenshotSize", screenshot_->size()); |
357 } | 368 } |
358 | 369 |
359 } // namespace content | 370 } // namespace content |
OLD | NEW |