| 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 271 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 282 } | 282 } |
| 283 | 283 |
| 284 void NavigationEntryImpl::SetHttpStatusCode(int http_status_code) { | 284 void NavigationEntryImpl::SetHttpStatusCode(int http_status_code) { |
| 285 http_status_code_ = http_status_code; | 285 http_status_code_ = http_status_code; |
| 286 } | 286 } |
| 287 | 287 |
| 288 int NavigationEntryImpl::GetHttpStatusCode() const { | 288 int NavigationEntryImpl::GetHttpStatusCode() const { |
| 289 return http_status_code_; | 289 return http_status_code_; |
| 290 } | 290 } |
| 291 | 291 |
| 292 void NavigationEntryImpl::SetRedirectChain( |
| 293 const std::vector<GURL>& redirect_chain) { |
| 294 redirect_chain_ = redirect_chain; |
| 295 } |
| 296 |
| 297 const std::vector<GURL>& NavigationEntryImpl::GetRedirectChain() const { |
| 298 return redirect_chain_; |
| 299 } |
| 300 |
| 292 void NavigationEntryImpl::SetCanLoadLocalResources(bool allow) { | 301 void NavigationEntryImpl::SetCanLoadLocalResources(bool allow) { |
| 293 can_load_local_resources_ = allow; | 302 can_load_local_resources_ = allow; |
| 294 } | 303 } |
| 295 | 304 |
| 296 bool NavigationEntryImpl::GetCanLoadLocalResources() const { | 305 bool NavigationEntryImpl::GetCanLoadLocalResources() const { |
| 297 return can_load_local_resources_; | 306 return can_load_local_resources_; |
| 298 } | 307 } |
| 299 | 308 |
| 300 void NavigationEntryImpl::SetFrameToNavigate(const std::string& frame_name) { | 309 void NavigationEntryImpl::SetFrameToNavigate(const std::string& frame_name) { |
| 301 frame_to_navigate_ = frame_name; | 310 frame_to_navigate_ = frame_name; |
| (...skipping 22 matching lines...) Expand all Loading... |
| 324 extra_data_.erase(key); | 333 extra_data_.erase(key); |
| 325 } | 334 } |
| 326 | 335 |
| 327 void NavigationEntryImpl::ResetForCommit() { | 336 void NavigationEntryImpl::ResetForCommit() { |
| 328 // Any state that only matters when a navigation entry is pending should be | 337 // Any state that only matters when a navigation entry is pending should be |
| 329 // cleared here. | 338 // cleared here. |
| 330 SetBrowserInitiatedPostData(NULL); | 339 SetBrowserInitiatedPostData(NULL); |
| 331 set_is_renderer_initiated(false); | 340 set_is_renderer_initiated(false); |
| 332 set_transferred_global_request_id(GlobalRequestID()); | 341 set_transferred_global_request_id(GlobalRequestID()); |
| 333 set_should_replace_entry(false); | 342 set_should_replace_entry(false); |
| 334 redirect_chain_.clear(); | |
| 335 set_should_clear_history_list(false); | 343 set_should_clear_history_list(false); |
| 336 set_frame_tree_node_id(-1); | 344 set_frame_tree_node_id(-1); |
| 337 } | 345 } |
| 338 | 346 |
| 339 void NavigationEntryImpl::SetScreenshotPNGData( | 347 void NavigationEntryImpl::SetScreenshotPNGData( |
| 340 scoped_refptr<base::RefCountedBytes> png_data) { | 348 scoped_refptr<base::RefCountedBytes> png_data) { |
| 341 screenshot_ = png_data; | 349 screenshot_ = png_data; |
| 342 if (screenshot_.get()) | 350 if (screenshot_.get()) |
| 343 UMA_HISTOGRAM_MEMORY_KB("Overscroll.ScreenshotSize", screenshot_->size()); | 351 UMA_HISTOGRAM_MEMORY_KB("Overscroll.ScreenshotSize", screenshot_->size()); |
| 344 } | 352 } |
| 345 | 353 |
| 346 } // namespace content | 354 } // namespace content |
| OLD | NEW |