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

Unified Diff: chrome/browser/ui/views/tabs/tab_drag_controller.cc

Issue 12179007: While screencasting a tab, do not disable rendering updates while hidden. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Execute delayed WasHidden() when capturer_count_ goes to zero. Created 7 years, 10 months 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/views/tabs/tab_drag_controller.cc
diff --git a/chrome/browser/ui/views/tabs/tab_drag_controller.cc b/chrome/browser/ui/views/tabs/tab_drag_controller.cc
index 697da2ea8ff557d0980d47af6eed1566954fc1ee..71adc03732ff6ba57bb2a979bfcb8f56ad5f580b 100644
--- a/chrome/browser/ui/views/tabs/tab_drag_controller.cc
+++ b/chrome/browser/ui/views/tabs/tab_drag_controller.cc
@@ -1140,7 +1140,7 @@ void TabDragController::Attach(TabStrip* attached_tabstrip,
}
// Return the WebContents to normalcy.
- source_dragged_contents()->SetCapturingContents(false);
+ source_dragged_contents()->DecrementCapturerCount();
}
// Inserting counts as a move. We don't want the tabs to jitter when the
@@ -1229,7 +1229,7 @@ void TabDragController::Detach(ReleaseCapture release_capture) {
// Prevent the WebContents HWND from being hidden by any of the model
// operations performed during the drag.
if (!detach_into_browser_)
- source_dragged_contents()->SetCapturingContents(true);
+ source_dragged_contents()->IncrementCapturerCount();
std::vector<gfx::Rect> drag_bounds = CalculateBoundsForDraggedTabs(0);
TabStripModel* attached_model = GetModel(attached_tabstrip_);
@@ -1663,6 +1663,13 @@ void TabDragController::RevertDrag() {
if (detach_into_browser_ && source_tabstrip_)
source_tabstrip_->GetWidget()->Activate();
+
+ // Return the WebContents to normalcy. If the tab was attached to a
+ // TabStrip before the revert, the decrement has already occurred.
+ // If the tab was destroyed, don't attempt to dereference the
+ // WebContents pointer.
+ if (!detach_into_browser_ && !attached_tabstrip_ && source_dragged_contents())
+ source_dragged_contents()->DecrementCapturerCount();
}
void TabDragController::ResetSelection(TabStripModel* model) {
@@ -1808,6 +1815,10 @@ void TabDragController::CompleteDrag() {
contentses, window_bounds, dock_info_, widget->IsMaximized());
ResetSelection(new_browser->tab_strip_model());
new_browser->window()->Show();
+
+ // Return the WebContents to normalcy.
+ if (!detach_into_browser_)
+ source_dragged_contents()->DecrementCapturerCount();
}
CleanUpHiddenFrame();

Powered by Google App Engine
This is Rietveld 408576698