| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/tab_contents/tab_contents.h" | 5 #include "content/browser/tab_contents/tab_contents.h" |
| 6 | 6 |
| 7 #include <cmath> | 7 #include <cmath> |
| 8 | 8 |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/metrics/histogram.h" | 10 #include "base/metrics/histogram.h" |
| (...skipping 578 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 589 FOR_EACH_OBSERVER(TabContentsObserver, | 589 FOR_EACH_OBSERVER(TabContentsObserver, |
| 590 observers_, | 590 observers_, |
| 591 NavigateToPendingEntry(entry.url(), reload_type)); | 591 NavigateToPendingEntry(entry.url(), reload_type)); |
| 592 | 592 |
| 593 if (delegate_) | 593 if (delegate_) |
| 594 delegate_->DidNavigateToPendingEntry(this); | 594 delegate_->DidNavigateToPendingEntry(this); |
| 595 | 595 |
| 596 return true; | 596 return true; |
| 597 } | 597 } |
| 598 | 598 |
| 599 void TabContents::SetHistoryLengthAndClear(int history_length) { |
| 600 RenderViewHost* rvh = render_view_host(); |
| 601 if (!rvh) |
| 602 return; |
| 603 rvh->Send(new ViewMsg_SetHistoryLengthAndClear(rvh->routing_id(), |
| 604 history_length)); |
| 605 } |
| 606 |
| 599 void TabContents::Stop() { | 607 void TabContents::Stop() { |
| 600 render_manager_.Stop(); | 608 render_manager_.Stop(); |
| 601 FOR_EACH_OBSERVER(TabContentsObserver, observers_, StopNavigation()); | 609 FOR_EACH_OBSERVER(TabContentsObserver, observers_, StopNavigation()); |
| 602 } | 610 } |
| 603 | 611 |
| 604 TabContents* TabContents::Clone() { | 612 TabContents* TabContents::Clone() { |
| 605 // We create a new SiteInstance so that the new tab won't share processes | 613 // We create a new SiteInstance so that the new tab won't share processes |
| 606 // with the old one. This can be changed in the future if we need it to share | 614 // with the old one. This can be changed in the future if we need it to share |
| 607 // processes for some reason. | 615 // processes for some reason. |
| 608 TabContents* tc = new TabContents( | 616 TabContents* tc = new TabContents( |
| (...skipping 1303 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1912 } | 1920 } |
| 1913 | 1921 |
| 1914 void TabContents::SwapInRenderViewHost(RenderViewHost* rvh) { | 1922 void TabContents::SwapInRenderViewHost(RenderViewHost* rvh) { |
| 1915 render_manager_.SwapInRenderViewHost(rvh); | 1923 render_manager_.SwapInRenderViewHost(rvh); |
| 1916 } | 1924 } |
| 1917 | 1925 |
| 1918 void TabContents::CreateViewAndSetSizeForRVH(RenderViewHost* rvh) { | 1926 void TabContents::CreateViewAndSetSizeForRVH(RenderViewHost* rvh) { |
| 1919 RenderWidgetHostView* rwh_view = view()->CreateViewForWidget(rvh); | 1927 RenderWidgetHostView* rwh_view = view()->CreateViewForWidget(rvh); |
| 1920 rwh_view->SetSize(view()->GetContainerSize()); | 1928 rwh_view->SetSize(view()->GetContainerSize()); |
| 1921 } | 1929 } |
| OLD | NEW |