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 1783 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1794 upload_position_ = upload_position; | 1794 upload_position_ = upload_position; |
1795 upload_size_ = upload_size; | 1795 upload_size_ = upload_size; |
1796 load_state_host_ = net::IDNToUnicode(url.host(), | 1796 load_state_host_ = net::IDNToUnicode(url.host(), |
1797 content::GetContentClient()->browser()->GetAcceptLangs(this)); | 1797 content::GetContentClient()->browser()->GetAcceptLangs(this)); |
1798 if (load_state_ == net::LOAD_STATE_READING_RESPONSE) | 1798 if (load_state_ == net::LOAD_STATE_READING_RESPONSE) |
1799 SetNotWaitingForResponse(); | 1799 SetNotWaitingForResponse(); |
1800 if (IsLoading()) | 1800 if (IsLoading()) |
1801 NotifyNavigationStateChanged(INVALIDATE_LOAD | INVALIDATE_TAB); | 1801 NotifyNavigationStateChanged(INVALIDATE_LOAD | INVALIDATE_TAB); |
1802 } | 1802 } |
1803 | 1803 |
1804 void TabContents::OffsetAndPruneHistory(int offset) { | |
1805 // TODO(cbentzel): Should this pass in a SiteInstance and a page_id to | |
1806 // make sure we get the right one. | |
gavinp
2011/08/08 16:39:47
NIT: Use a question mark on questions.
| |
1807 RenderViewHost* rvh = render_view_host(); | |
1808 if (!rvh) | |
1809 return; | |
1810 rvh->Send(new ViewMsg_OffsetAndPruneHistory(rvh->routing_id(), offset)); | |
1811 } | |
1812 | |
1804 void TabContents::WorkerCrashed() { | 1813 void TabContents::WorkerCrashed() { |
1805 if (delegate()) | 1814 if (delegate()) |
1806 delegate()->WorkerCrashed(this); | 1815 delegate()->WorkerCrashed(this); |
1807 } | 1816 } |
1808 | 1817 |
1809 void TabContents::BeforeUnloadFiredFromRenderManager( | 1818 void TabContents::BeforeUnloadFiredFromRenderManager( |
1810 bool proceed, | 1819 bool proceed, |
1811 bool* proceed_to_fire_unload) { | 1820 bool* proceed_to_fire_unload) { |
1812 if (delegate()) | 1821 if (delegate()) |
1813 delegate()->BeforeUnloadFired(this, proceed, proceed_to_fire_unload); | 1822 delegate()->BeforeUnloadFired(this, proceed, proceed_to_fire_unload); |
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1904 } | 1913 } |
1905 | 1914 |
1906 void TabContents::SwapInRenderViewHost(RenderViewHost* rvh) { | 1915 void TabContents::SwapInRenderViewHost(RenderViewHost* rvh) { |
1907 render_manager_.SwapInRenderViewHost(rvh); | 1916 render_manager_.SwapInRenderViewHost(rvh); |
1908 } | 1917 } |
1909 | 1918 |
1910 void TabContents::CreateViewAndSetSizeForRVH(RenderViewHost* rvh) { | 1919 void TabContents::CreateViewAndSetSizeForRVH(RenderViewHost* rvh) { |
1911 RenderWidgetHostView* rwh_view = view()->CreateViewForWidget(rvh); | 1920 RenderWidgetHostView* rwh_view = view()->CreateViewForWidget(rvh); |
1912 rwh_view->SetSize(view()->GetContainerSize()); | 1921 rwh_view->SetSize(view()->GetContainerSize()); |
1913 } | 1922 } |
OLD | NEW |