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

Side by Side Diff: content/browser/media/capture/web_contents_tracker.cc

Issue 2859223005: Tab Capture: Set size before changing target RWHV (Closed)
Patch Set: Created 3 years, 7 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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/media/capture/web_contents_tracker.h" 5 #include "content/browser/media/capture/web_contents_tracker.h"
6 6
7 #include "base/threading/thread_task_runner_handle.h" 7 #include "base/threading/thread_task_runner_handle.h"
8 #include "content/public/browser/browser_thread.h" 8 #include "content/public/browser/browser_thread.h"
9 #include "content/public/browser/render_frame_host.h" 9 #include "content/public/browser/render_frame_host.h"
10 #include "content/public/browser/render_widget_host_view.h" 10 #include "content/public/browser/render_widget_host_view.h"
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
100 } 100 }
101 101
102 task_runner_->PostTask(FROM_HERE, 102 task_runner_->PostTask(FROM_HERE,
103 base::Bind(&WebContentsTracker::MaybeDoCallback, this, 103 base::Bind(&WebContentsTracker::MaybeDoCallback, this,
104 is_still_tracking())); 104 is_still_tracking()));
105 } 105 }
106 106
107 void WebContentsTracker::MaybeDoCallback(bool was_still_tracking) { 107 void WebContentsTracker::MaybeDoCallback(bool was_still_tracking) {
108 DCHECK(task_runner_->BelongsToCurrentThread()); 108 DCHECK(task_runner_->BelongsToCurrentThread());
109 109
110 // Notify of a size change just before notifying of a new target. This allows
111 // the downstream implementation to capture the first frame from the new
112 // target at the correct resolution. http://crbug.com/704277
113 if (was_still_tracking)
114 MaybeDoResizeCallback();
110 if (!callback_.is_null()) 115 if (!callback_.is_null())
111 callback_.Run(was_still_tracking); 116 callback_.Run(was_still_tracking);
112 if (was_still_tracking)
113 MaybeDoResizeCallback();
114 } 117 }
115 118
116 void WebContentsTracker::MaybeDoResizeCallback() { 119 void WebContentsTracker::MaybeDoResizeCallback() {
117 DCHECK(task_runner_->BelongsToCurrentThread()); 120 DCHECK(task_runner_->BelongsToCurrentThread());
118 121
119 if (!resize_callback_.is_null()) 122 if (!resize_callback_.is_null())
120 resize_callback_.Run(); 123 resize_callback_.Run();
121 } 124 }
122 125
123 void WebContentsTracker::StartObservingWebContents(int render_process_id, 126 void WebContentsTracker::StartObservingWebContents(int render_process_id,
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
176 DVLOG(1) << "DidShowFullscreenWidget()"; 179 DVLOG(1) << "DidShowFullscreenWidget()";
177 OnPossibleTargetChange(false); 180 OnPossibleTargetChange(false);
178 } 181 }
179 182
180 void WebContentsTracker::DidDestroyFullscreenWidget() { 183 void WebContentsTracker::DidDestroyFullscreenWidget() {
181 DVLOG(1) << "DidDestroyFullscreenWidget()"; 184 DVLOG(1) << "DidDestroyFullscreenWidget()";
182 OnPossibleTargetChange(false); 185 OnPossibleTargetChange(false);
183 } 186 }
184 187
185 } // namespace content 188 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698