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 2255 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2266 | 2266 |
2267 NavigationEntry* | 2267 NavigationEntry* |
2268 TabContents::GetLastCommittedNavigationEntryForRenderManager() { | 2268 TabContents::GetLastCommittedNavigationEntryForRenderManager() { |
2269 return controller_.GetLastCommittedEntry(); | 2269 return controller_.GetLastCommittedEntry(); |
2270 } | 2270 } |
2271 | 2271 |
2272 bool TabContents::CreateRenderViewForRenderManager( | 2272 bool TabContents::CreateRenderViewForRenderManager( |
2273 RenderViewHost* render_view_host) { | 2273 RenderViewHost* render_view_host) { |
2274 RenderWidgetHostView* rwh_view = view_->CreateViewForWidget(render_view_host); | 2274 RenderWidgetHostView* rwh_view = view_->CreateViewForWidget(render_view_host); |
2275 | 2275 |
| 2276 // Now that the RenderView has been created, we need to tell it its size. |
| 2277 rwh_view->SetSize(view_->GetContainerSize()); |
| 2278 |
2276 if (!render_view_host->CreateRenderView(string16())) | 2279 if (!render_view_host->CreateRenderView(string16())) |
2277 return false; | 2280 return false; |
2278 | 2281 |
2279 // Now that the RenderView has been created, we need to tell it its size. | |
2280 rwh_view->SetSize(view_->GetContainerSize()); | |
2281 | |
2282 UpdateMaxPageIDIfNecessary(render_view_host->site_instance(), | 2282 UpdateMaxPageIDIfNecessary(render_view_host->site_instance(), |
2283 render_view_host); | 2283 render_view_host); |
2284 return true; | 2284 return true; |
2285 } | 2285 } |
2286 | 2286 |
2287 void TabContents::Observe(NotificationType type, | 2287 void TabContents::Observe(NotificationType type, |
2288 const NotificationSource& source, | 2288 const NotificationSource& source, |
2289 const NotificationDetails& details) { | 2289 const NotificationDetails& details) { |
2290 switch (type.value) { | 2290 switch (type.value) { |
2291 case NotificationType::PREF_CHANGED: { | 2291 case NotificationType::PREF_CHANGED: { |
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2398 | 2398 |
2399 void TabContents::CreateViewAndSetSizeForRVH(RenderViewHost* rvh) { | 2399 void TabContents::CreateViewAndSetSizeForRVH(RenderViewHost* rvh) { |
2400 RenderWidgetHostView* rwh_view = view()->CreateViewForWidget(rvh); | 2400 RenderWidgetHostView* rwh_view = view()->CreateViewForWidget(rvh); |
2401 rwh_view->SetSize(view()->GetContainerSize()); | 2401 rwh_view->SetSize(view()->GetContainerSize()); |
2402 } | 2402 } |
2403 | 2403 |
2404 void TabContents::OnOnlineStateChanged(bool online) { | 2404 void TabContents::OnOnlineStateChanged(bool online) { |
2405 render_view_host()->Send(new ViewMsg_NetworkStateChanged( | 2405 render_view_host()->Send(new ViewMsg_NetworkStateChanged( |
2406 render_view_host()->routing_id(), online)); | 2406 render_view_host()->routing_id(), online)); |
2407 } | 2407 } |
OLD | NEW |