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 bool NavigationEntryImpl::IsRestored() const { | 301 bool NavigationEntryImpl::IsRestored() const { |
293 return restore_type_ != RESTORE_NONE; | 302 return restore_type_ != RESTORE_NONE; |
294 } | 303 } |
295 | 304 |
296 void NavigationEntryImpl::SetCanLoadLocalResources(bool allow) { | 305 void NavigationEntryImpl::SetCanLoadLocalResources(bool allow) { |
297 can_load_local_resources_ = allow; | 306 can_load_local_resources_ = allow; |
298 } | 307 } |
299 | 308 |
300 bool NavigationEntryImpl::GetCanLoadLocalResources() const { | 309 bool NavigationEntryImpl::GetCanLoadLocalResources() const { |
301 return can_load_local_resources_; | 310 return can_load_local_resources_; |
(...skipping 26 matching lines...) Expand all Loading... |
328 extra_data_.erase(key); | 337 extra_data_.erase(key); |
329 } | 338 } |
330 | 339 |
331 void NavigationEntryImpl::ResetForCommit() { | 340 void NavigationEntryImpl::ResetForCommit() { |
332 // Any state that only matters when a navigation entry is pending should be | 341 // Any state that only matters when a navigation entry is pending should be |
333 // cleared here. | 342 // cleared here. |
334 SetBrowserInitiatedPostData(NULL); | 343 SetBrowserInitiatedPostData(NULL); |
335 set_is_renderer_initiated(false); | 344 set_is_renderer_initiated(false); |
336 set_transferred_global_request_id(GlobalRequestID()); | 345 set_transferred_global_request_id(GlobalRequestID()); |
337 set_should_replace_entry(false); | 346 set_should_replace_entry(false); |
338 redirect_chain_.clear(); | 347 |
339 set_should_clear_history_list(false); | 348 set_should_clear_history_list(false); |
340 set_frame_tree_node_id(-1); | 349 set_frame_tree_node_id(-1); |
341 } | 350 } |
342 | 351 |
343 void NavigationEntryImpl::SetScreenshotPNGData( | 352 void NavigationEntryImpl::SetScreenshotPNGData( |
344 scoped_refptr<base::RefCountedBytes> png_data) { | 353 scoped_refptr<base::RefCountedBytes> png_data) { |
345 screenshot_ = png_data; | 354 screenshot_ = png_data; |
346 if (screenshot_.get()) | 355 if (screenshot_.get()) |
347 UMA_HISTOGRAM_MEMORY_KB("Overscroll.ScreenshotSize", screenshot_->size()); | 356 UMA_HISTOGRAM_MEMORY_KB("Overscroll.ScreenshotSize", screenshot_->size()); |
348 } | 357 } |
349 | 358 |
350 } // namespace content | 359 } // namespace content |
OLD | NEW |