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 2265 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2276 | 2276 |
2277 NavigationEntry* | 2277 NavigationEntry* |
2278 TabContents::GetLastCommittedNavigationEntryForRenderManager() { | 2278 TabContents::GetLastCommittedNavigationEntryForRenderManager() { |
2279 return controller_.GetLastCommittedEntry(); | 2279 return controller_.GetLastCommittedEntry(); |
2280 } | 2280 } |
2281 | 2281 |
2282 bool TabContents::CreateRenderViewForRenderManager( | 2282 bool TabContents::CreateRenderViewForRenderManager( |
2283 RenderViewHost* render_view_host) { | 2283 RenderViewHost* render_view_host) { |
2284 RenderWidgetHostView* rwh_view = view_->CreateViewForWidget(render_view_host); | 2284 RenderWidgetHostView* rwh_view = view_->CreateViewForWidget(render_view_host); |
2285 | 2285 |
2286 // Now that the RenderView has been created, we need to tell it its size. | |
2287 rwh_view->SetSize(view_->GetContainerSize()); | |
apatrick_chromium
2011/04/27 18:34:34
CreateRenderView calls GetCompositing, which assum
| |
2288 | |
2286 if (!render_view_host->CreateRenderView(string16())) | 2289 if (!render_view_host->CreateRenderView(string16())) |
2287 return false; | 2290 return false; |
2288 | 2291 |
2289 // Now that the RenderView has been created, we need to tell it its size. | |
2290 rwh_view->SetSize(view_->GetContainerSize()); | |
2291 | |
2292 UpdateMaxPageIDIfNecessary(render_view_host->site_instance(), | 2292 UpdateMaxPageIDIfNecessary(render_view_host->site_instance(), |
2293 render_view_host); | 2293 render_view_host); |
2294 return true; | 2294 return true; |
2295 } | 2295 } |
2296 | 2296 |
2297 void TabContents::Observe(NotificationType type, | 2297 void TabContents::Observe(NotificationType type, |
2298 const NotificationSource& source, | 2298 const NotificationSource& source, |
2299 const NotificationDetails& details) { | 2299 const NotificationDetails& details) { |
2300 switch (type.value) { | 2300 switch (type.value) { |
2301 case NotificationType::PREF_CHANGED: { | 2301 case NotificationType::PREF_CHANGED: { |
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2408 | 2408 |
2409 void TabContents::CreateViewAndSetSizeForRVH(RenderViewHost* rvh) { | 2409 void TabContents::CreateViewAndSetSizeForRVH(RenderViewHost* rvh) { |
2410 RenderWidgetHostView* rwh_view = view()->CreateViewForWidget(rvh); | 2410 RenderWidgetHostView* rwh_view = view()->CreateViewForWidget(rvh); |
2411 rwh_view->SetSize(view()->GetContainerSize()); | 2411 rwh_view->SetSize(view()->GetContainerSize()); |
2412 } | 2412 } |
2413 | 2413 |
2414 void TabContents::OnOnlineStateChanged(bool online) { | 2414 void TabContents::OnOnlineStateChanged(bool online) { |
2415 render_view_host()->Send(new ViewMsg_NetworkStateChanged( | 2415 render_view_host()->Send(new ViewMsg_NetworkStateChanged( |
2416 render_view_host()->routing_id(), online)); | 2416 render_view_host()->routing_id(), online)); |
2417 } | 2417 } |
OLD | NEW |