Chromium Code Reviews| 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 192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 203 static_cast<int>(WebKit::WebView::maxTextSizeMultiplier * 100)), | 203 static_cast<int>(WebKit::WebView::maxTextSizeMultiplier * 100)), |
| 204 temporary_zoom_settings_(false), | 204 temporary_zoom_settings_(false), |
| 205 content_restrictions_(0) { | 205 content_restrictions_(0) { |
| 206 | 206 |
| 207 render_manager_.Init(browser_context, site_instance, routing_id); | 207 render_manager_.Init(browser_context, site_instance, routing_id); |
| 208 | 208 |
| 209 // We have the initial size of the view be based on the size of the passed in | 209 // We have the initial size of the view be based on the size of the passed in |
| 210 // tab contents (normally a tab from the same window). | 210 // tab contents (normally a tab from the same window). |
| 211 view_->CreateView(base_tab_contents ? | 211 view_->CreateView(base_tab_contents ? |
| 212 base_tab_contents->view()->GetContainerSize() : gfx::Size()); | 212 base_tab_contents->view()->GetContainerSize() : gfx::Size()); |
| 213 | |
| 214 java_bridge_dispatcher_host_manager_.reset( | |
|
jam
2011/10/21 16:18:21
we don't need to add this for all of chrome, do we
Steve Block
2011/10/21 16:27:48
No, this isn't needed unless we want to use the Ja
| |
| 215 new JavaBridgeDispatcherHostManager(this)); | |
| 213 } | 216 } |
| 214 | 217 |
| 215 TabContents::~TabContents() { | 218 TabContents::~TabContents() { |
| 216 is_being_destroyed_ = true; | 219 is_being_destroyed_ = true; |
| 217 | 220 |
| 218 // Clear out any JavaScript state. | 221 // Clear out any JavaScript state. |
| 219 if (dialog_creator_) | 222 if (dialog_creator_) |
| 220 dialog_creator_->ResetJavaScriptState(this); | 223 dialog_creator_->ResetJavaScriptState(this); |
| 221 | 224 |
| 222 NotifyDisconnected(); | 225 NotifyDisconnected(); |
| (...skipping 1241 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1464 SetIsLoading(false, NULL); | 1467 SetIsLoading(false, NULL); |
| 1465 NotifyDisconnected(); | 1468 NotifyDisconnected(); |
| 1466 SetIsCrashed(status, error_code); | 1469 SetIsCrashed(status, error_code); |
| 1467 view()->OnTabCrashed(crashed_status(), crashed_error_code()); | 1470 view()->OnTabCrashed(crashed_status(), crashed_error_code()); |
| 1468 | 1471 |
| 1469 FOR_EACH_OBSERVER(TabContentsObserver, observers_, RenderViewGone()); | 1472 FOR_EACH_OBSERVER(TabContentsObserver, observers_, RenderViewGone()); |
| 1470 } | 1473 } |
| 1471 | 1474 |
| 1472 void TabContents::RenderViewDeleted(RenderViewHost* rvh) { | 1475 void TabContents::RenderViewDeleted(RenderViewHost* rvh) { |
| 1473 render_manager_.RenderViewDeleted(rvh); | 1476 render_manager_.RenderViewDeleted(rvh); |
| 1477 FOR_EACH_OBSERVER(TabContentsObserver, observers_, RenderViewDeleted(rvh)); | |
| 1474 } | 1478 } |
| 1475 | 1479 |
| 1476 void TabContents::DidNavigate(RenderViewHost* rvh, | 1480 void TabContents::DidNavigate(RenderViewHost* rvh, |
| 1477 const ViewHostMsg_FrameNavigate_Params& params) { | 1481 const ViewHostMsg_FrameNavigate_Params& params) { |
| 1478 if (content::PageTransitionIsMainFrame(params.transition)) | 1482 if (content::PageTransitionIsMainFrame(params.transition)) |
| 1479 render_manager_.DidNavigateMainFrame(rvh); | 1483 render_manager_.DidNavigateMainFrame(rvh); |
| 1480 | 1484 |
| 1481 // Update the site of the SiteInstance if it doesn't have one yet. | 1485 // Update the site of the SiteInstance if it doesn't have one yet. |
| 1482 if (!GetSiteInstance()->has_site()) | 1486 if (!GetSiteInstance()->has_site()) |
| 1483 GetSiteInstance()->SetSite(params.url); | 1487 GetSiteInstance()->SetSite(params.url); |
| (...skipping 510 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1994 void TabContents::CreateViewAndSetSizeForRVH(RenderViewHost* rvh) { | 1998 void TabContents::CreateViewAndSetSizeForRVH(RenderViewHost* rvh) { |
| 1995 RenderWidgetHostView* rwh_view = view()->CreateViewForWidget(rvh); | 1999 RenderWidgetHostView* rwh_view = view()->CreateViewForWidget(rvh); |
| 1996 rwh_view->SetSize(view()->GetContainerSize()); | 2000 rwh_view->SetSize(view()->GetContainerSize()); |
| 1997 } | 2001 } |
| 1998 | 2002 |
| 1999 bool TabContents::GotResponseToLockMouseRequest(bool allowed) { | 2003 bool TabContents::GotResponseToLockMouseRequest(bool allowed) { |
| 2000 return render_view_host() ? | 2004 return render_view_host() ? |
| 2001 render_view_host()->GotResponseToLockMouseRequest(allowed) : false; | 2005 render_view_host()->GotResponseToLockMouseRequest(allowed) : false; |
| 2002 } | 2006 } |
| 2003 | 2007 |
| OLD | NEW |