Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(79)

Side by Side Diff: content/browser/tab_contents/tab_contents.cc

Issue 8539027: Add SwappedOut to TabContentsDelegate to allow us to correctly delete TabContents. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix linux compile Created 9 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 1627 matching lines...) Expand 10 before | Expand all | Expand 10 after
1638 if (view()->IsDoingDrag()) { 1638 if (view()->IsDoingDrag()) {
1639 view()->CancelDragAndCloseTab(); 1639 view()->CancelDragAndCloseTab();
1640 return; 1640 return;
1641 } 1641 }
1642 1642
1643 // Ignore this if it comes from a RenderViewHost that we aren't showing. 1643 // Ignore this if it comes from a RenderViewHost that we aren't showing.
1644 if (delegate() && rvh == render_view_host()) 1644 if (delegate() && rvh == render_view_host())
1645 delegate()->CloseContents(this); 1645 delegate()->CloseContents(this);
1646 } 1646 }
1647 1647
1648 void TabContents::SwappedOut(RenderViewHost* rvh) {
1649 if (delegate() && rvh == render_view_host())
1650 delegate()->SwappedOut(this);
1651 }
1652
1648 void TabContents::RequestMove(const gfx::Rect& new_bounds) { 1653 void TabContents::RequestMove(const gfx::Rect& new_bounds) {
1649 if (delegate() && delegate()->IsPopupOrPanel(this)) 1654 if (delegate() && delegate()->IsPopupOrPanel(this))
1650 delegate()->MoveContents(this, new_bounds); 1655 delegate()->MoveContents(this, new_bounds);
1651 } 1656 }
1652 1657
1653 void TabContents::DidStartLoading() { 1658 void TabContents::DidStartLoading() {
1654 SetIsLoading(true, NULL); 1659 SetIsLoading(true, NULL);
1655 1660
1656 if (delegate() && content_restrictions_) { 1661 if (delegate() && content_restrictions_) {
1657 content_restrictions_ = 0; 1662 content_restrictions_ = 0;
(...skipping 357 matching lines...) Expand 10 before | Expand all | Expand 10 after
2015 2020
2016 void TabContents::CreateViewAndSetSizeForRVH(RenderViewHost* rvh) { 2021 void TabContents::CreateViewAndSetSizeForRVH(RenderViewHost* rvh) {
2017 RenderWidgetHostView* rwh_view = view()->CreateViewForWidget(rvh); 2022 RenderWidgetHostView* rwh_view = view()->CreateViewForWidget(rvh);
2018 rwh_view->SetSize(view()->GetContainerSize()); 2023 rwh_view->SetSize(view()->GetContainerSize());
2019 } 2024 }
2020 2025
2021 bool TabContents::GotResponseToLockMouseRequest(bool allowed) { 2026 bool TabContents::GotResponseToLockMouseRequest(bool allowed) {
2022 return render_view_host() ? 2027 return render_view_host() ?
2023 render_view_host()->GotResponseToLockMouseRequest(allowed) : false; 2028 render_view_host()->GotResponseToLockMouseRequest(allowed) : false;
2024 } 2029 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698