| 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 xss_detected_(false), |
| 56 frame_tree_node_id_(-1) { | 57 frame_tree_node_id_(-1) { |
| 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), |
| 86 xss_detected_(false), |
| 85 frame_tree_node_id_(-1) { | 87 frame_tree_node_id_(-1) { |
| 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 |
| (...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 303 } | 305 } |
| 304 | 306 |
| 305 void NavigationEntryImpl::SetCanLoadLocalResources(bool allow) { | 307 void NavigationEntryImpl::SetCanLoadLocalResources(bool allow) { |
| 306 can_load_local_resources_ = allow; | 308 can_load_local_resources_ = allow; |
| 307 } | 309 } |
| 308 | 310 |
| 309 bool NavigationEntryImpl::GetCanLoadLocalResources() const { | 311 bool NavigationEntryImpl::GetCanLoadLocalResources() const { |
| 310 return can_load_local_resources_; | 312 return can_load_local_resources_; |
| 311 } | 313 } |
| 312 | 314 |
| 315 bool NavigationEntryImpl::GetXssDetected() const { |
| 316 return xss_detected_; |
| 317 } |
| 318 |
| 313 void NavigationEntryImpl::SetFrameToNavigate(const std::string& frame_name) { | 319 void NavigationEntryImpl::SetFrameToNavigate(const std::string& frame_name) { |
| 314 frame_to_navigate_ = frame_name; | 320 frame_to_navigate_ = frame_name; |
| 315 } | 321 } |
| 316 | 322 |
| 317 const std::string& NavigationEntryImpl::GetFrameToNavigate() const { | 323 const std::string& NavigationEntryImpl::GetFrameToNavigate() const { |
| 318 return frame_to_navigate_; | 324 return frame_to_navigate_; |
| 319 } | 325 } |
| 320 | 326 |
| 321 void NavigationEntryImpl::SetExtraData(const std::string& key, | 327 void NavigationEntryImpl::SetExtraData(const std::string& key, |
| 322 const base::string16& data) { | 328 const base::string16& data) { |
| (...skipping 27 matching lines...) Expand all Loading... |
| 350 } | 356 } |
| 351 | 357 |
| 352 void NavigationEntryImpl::SetScreenshotPNGData( | 358 void NavigationEntryImpl::SetScreenshotPNGData( |
| 353 scoped_refptr<base::RefCountedBytes> png_data) { | 359 scoped_refptr<base::RefCountedBytes> png_data) { |
| 354 screenshot_ = png_data; | 360 screenshot_ = png_data; |
| 355 if (screenshot_.get()) | 361 if (screenshot_.get()) |
| 356 UMA_HISTOGRAM_MEMORY_KB("Overscroll.ScreenshotSize", screenshot_->size()); | 362 UMA_HISTOGRAM_MEMORY_KB("Overscroll.ScreenshotSize", screenshot_->size()); |
| 357 } | 363 } |
| 358 | 364 |
| 359 } // namespace content | 365 } // namespace content |
| OLD | NEW |