OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 #ifndef CHROME_BROWSER_EXTENSIONS_API_TAB_CAPTURE_OFFSCREEN_TAB_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_API_TAB_CAPTURE_OFFSCREEN_TAB_H_ |
6 #define CHROME_BROWSER_EXTENSIONS_API_TAB_CAPTURE_OFFSCREEN_TAB_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_API_TAB_CAPTURE_OFFSCREEN_TAB_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <string> | 10 #include <string> |
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
179 void DieIfContentCaptureEnded(); | 179 void DieIfContentCaptureEnded(); |
180 | 180 |
181 OffscreenTabsOwner* const owner_; | 181 OffscreenTabsOwner* const owner_; |
182 | 182 |
183 // The initial navigation URL, which may or may not match the current URL if | 183 // The initial navigation URL, which may or may not match the current URL if |
184 // page-initiated navigations have occurred. | 184 // page-initiated navigations have occurred. |
185 GURL start_url_; | 185 GURL start_url_; |
186 | 186 |
187 // A non-shared off-the-record profile based on the profile of the extension | 187 // A non-shared off-the-record profile based on the profile of the extension |
188 // background page. | 188 // background page. |
189 const scoped_ptr<Profile> profile_; | 189 const std::unique_ptr<Profile> profile_; |
190 | 190 |
191 // The WebContents containing the off-screen tab's page. | 191 // The WebContents containing the off-screen tab's page. |
192 scoped_ptr<content::WebContents> offscreen_tab_web_contents_; | 192 std::unique_ptr<content::WebContents> offscreen_tab_web_contents_; |
193 | 193 |
194 // The time at which Start() finished creating |offscreen_tab_web_contents_|. | 194 // The time at which Start() finished creating |offscreen_tab_web_contents_|. |
195 base::TimeTicks start_time_; | 195 base::TimeTicks start_time_; |
196 | 196 |
197 // Set to the original size of the renderer just before entering fullscreen | 197 // Set to the original size of the renderer just before entering fullscreen |
198 // mode. When not in fullscreen mode, this is an empty size. | 198 // mode. When not in fullscreen mode, this is an empty size. |
199 gfx::Size non_fullscreen_size_; | 199 gfx::Size non_fullscreen_size_; |
200 | 200 |
201 // Poll timer to monitor the capturer count on |offscreen_tab_web_contents_|. | 201 // Poll timer to monitor the capturer count on |offscreen_tab_web_contents_|. |
202 // When the capturer count returns to zero, this OffscreenTab is automatically | 202 // When the capturer count returns to zero, this OffscreenTab is automatically |
203 // destroyed. | 203 // destroyed. |
204 // | 204 // |
205 // TODO(miu): Add a method to WebContentsObserver to report capturer count | 205 // TODO(miu): Add a method to WebContentsObserver to report capturer count |
206 // changes and get rid of this polling-based approach. | 206 // changes and get rid of this polling-based approach. |
207 // http://crbug.com/540965 | 207 // http://crbug.com/540965 |
208 base::Timer capture_poll_timer_; | 208 base::Timer capture_poll_timer_; |
209 | 209 |
210 // This is false until after the Start() method is called, and capture of the | 210 // This is false until after the Start() method is called, and capture of the |
211 // |offscreen_tab_web_contents_| is first detected. | 211 // |offscreen_tab_web_contents_| is first detected. |
212 bool content_capture_was_detected_; | 212 bool content_capture_was_detected_; |
213 | 213 |
214 DISALLOW_COPY_AND_ASSIGN(OffscreenTab); | 214 DISALLOW_COPY_AND_ASSIGN(OffscreenTab); |
215 }; | 215 }; |
216 | 216 |
217 } // namespace extensions | 217 } // namespace extensions |
218 | 218 |
219 #endif // CHROME_BROWSER_EXTENSIONS_API_TAB_CAPTURE_OFFSCREEN_TAB_H_ | 219 #endif // CHROME_BROWSER_EXTENSIONS_API_TAB_CAPTURE_OFFSCREEN_TAB_H_ |
OLD | NEW |