| 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 1572 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1583 | 1583 |
| 1584 content::RendererPreferences TabContents::GetRendererPrefs( | 1584 content::RendererPreferences TabContents::GetRendererPrefs( |
| 1585 content::BrowserContext* browser_context) const { | 1585 content::BrowserContext* browser_context) const { |
| 1586 return renderer_preferences_; | 1586 return renderer_preferences_; |
| 1587 } | 1587 } |
| 1588 | 1588 |
| 1589 TabContents* TabContents::GetAsTabContents() { | 1589 TabContents* TabContents::GetAsTabContents() { |
| 1590 return this; | 1590 return this; |
| 1591 } | 1591 } |
| 1592 | 1592 |
| 1593 WebContents* TabContents::GetAsWebContents() { |
| 1594 return this; |
| 1595 } |
| 1596 |
| 1593 content::ViewType TabContents::GetRenderViewType() const { | 1597 content::ViewType TabContents::GetRenderViewType() const { |
| 1594 return view_type_; | 1598 return view_type_; |
| 1595 } | 1599 } |
| 1596 | 1600 |
| 1597 void TabContents::RenderViewCreated(RenderViewHost* render_view_host) { | 1601 void TabContents::RenderViewCreated(RenderViewHost* render_view_host) { |
| 1598 content::NotificationService::current()->Notify( | 1602 content::NotificationService::current()->Notify( |
| 1599 content::NOTIFICATION_RENDER_VIEW_HOST_CREATED_FOR_TAB, | 1603 content::NOTIFICATION_RENDER_VIEW_HOST_CREATED_FOR_TAB, |
| 1600 content::Source<TabContents>(this), | 1604 content::Source<TabContents>(this), |
| 1601 content::Details<RenderViewHost>(render_view_host)); | 1605 content::Details<RenderViewHost>(render_view_host)); |
| 1602 NavigationEntry* entry = controller_.GetActiveEntry(); | 1606 NavigationEntry* entry = controller_.GetActiveEntry(); |
| (...skipping 606 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2209 encoding_ = content::GetContentClient()->browser()-> | 2213 encoding_ = content::GetContentClient()->browser()-> |
| 2210 GetCanonicalEncodingNameByAliasName(encoding); | 2214 GetCanonicalEncodingNameByAliasName(encoding); |
| 2211 } | 2215 } |
| 2212 | 2216 |
| 2213 void TabContents::CreateViewAndSetSizeForRVH(RenderViewHost* rvh) { | 2217 void TabContents::CreateViewAndSetSizeForRVH(RenderViewHost* rvh) { |
| 2214 RenderWidgetHostView* rwh_view = GetView()->CreateViewForWidget(rvh); | 2218 RenderWidgetHostView* rwh_view = GetView()->CreateViewForWidget(rvh); |
| 2215 // Can be NULL during tests. | 2219 // Can be NULL during tests. |
| 2216 if (rwh_view) | 2220 if (rwh_view) |
| 2217 rwh_view->SetSize(GetView()->GetContainerSize()); | 2221 rwh_view->SetSize(GetView()->GetContainerSize()); |
| 2218 } | 2222 } |
| OLD | NEW |