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/browser/frame_host/navigation_controller_impl.h" | 10 #include "content/browser/frame_host/navigation_controller_impl.h" |
(...skipping 390 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
401 set_should_clear_history_list(false); | 401 set_should_clear_history_list(false); |
402 set_frame_tree_node_id(-1); | 402 set_frame_tree_node_id(-1); |
403 | 403 |
404 #if defined(OS_ANDROID) | 404 #if defined(OS_ANDROID) |
405 // Reset the time stamp so that the metrics are not reported if this entry is | 405 // Reset the time stamp so that the metrics are not reported if this entry is |
406 // loaded again in the future. | 406 // loaded again in the future. |
407 set_intent_received_timestamp(base::TimeTicks()); | 407 set_intent_received_timestamp(base::TimeTicks()); |
408 #endif | 408 #endif |
409 } | 409 } |
410 | 410 |
| 411 void NavigationEntryImpl::AddOrUpdateFrameEntry(int64 frame_tree_node_id, |
| 412 SiteInstanceImpl* site_instance, |
| 413 const GURL& url, |
| 414 const Referrer& referrer) { |
| 415 // TODO(creis): Walk tree to find the node to update. |
| 416 // TODO(creis): Only create a new entry if one doesn't exist yet. |
| 417 FrameNavigationEntry* frame_entry = |
| 418 new FrameNavigationEntry(site_instance, url, referrer); |
| 419 root_node()->children.push_back( |
| 420 new NavigationEntryImpl::TreeNode(frame_entry)); |
| 421 } |
| 422 |
411 void NavigationEntryImpl::SetScreenshotPNGData( | 423 void NavigationEntryImpl::SetScreenshotPNGData( |
412 scoped_refptr<base::RefCountedBytes> png_data) { | 424 scoped_refptr<base::RefCountedBytes> png_data) { |
413 screenshot_ = png_data; | 425 screenshot_ = png_data; |
414 if (screenshot_.get()) | 426 if (screenshot_.get()) |
415 UMA_HISTOGRAM_MEMORY_KB("Overscroll.ScreenshotSize", screenshot_->size()); | 427 UMA_HISTOGRAM_MEMORY_KB("Overscroll.ScreenshotSize", screenshot_->size()); |
416 } | 428 } |
417 | 429 |
418 GURL NavigationEntryImpl::GetHistoryURLForDataURL() const { | 430 GURL NavigationEntryImpl::GetHistoryURLForDataURL() const { |
419 return GetBaseURLForDataURL().is_empty() ? GURL() : GetVirtualURL(); | 431 return GetBaseURLForDataURL().is_empty() ? GURL() : GetVirtualURL(); |
420 } | 432 } |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
479 GetBrowserInitiatedPostData()->size()); | 491 GetBrowserInitiatedPostData()->size()); |
480 } | 492 } |
481 | 493 |
482 return StartNavigationParams( | 494 return StartNavigationParams( |
483 GetHasPostData(), extra_headers(), browser_initiated_post_data, | 495 GetHasPostData(), extra_headers(), browser_initiated_post_data, |
484 should_replace_entry(), transferred_global_request_id().child_id, | 496 should_replace_entry(), transferred_global_request_id().child_id, |
485 transferred_global_request_id().request_id); | 497 transferred_global_request_id().request_id); |
486 } | 498 } |
487 | 499 |
488 } // namespace content | 500 } // namespace content |
OLD | NEW |