Chromium Code Reviews| 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_PRESENTATION_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_API_TAB_CAPTURE_OFFSCREEN_PRESENTATION_H_ |
| 6 #define CHROME_BROWSER_EXTENSIONS_API_TAB_CAPTURE_OFFSCREEN_PRESENTATION_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_API_TAB_CAPTURE_OFFSCREEN_PRESENTATION_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| 11 #include "base/memory/scoped_vector.h" | 11 #include "base/memory/scoped_vector.h" |
| 12 #include "base/time/time.h" | 12 #include "base/time/time.h" |
| 13 #include "base/timer/timer.h" | 13 #include "base/timer/timer.h" |
| 14 #include "content/public/browser/web_contents_delegate.h" | 14 #include "content/public/browser/web_contents_delegate.h" |
| 15 #include "content/public/browser/web_contents_observer.h" | 15 #include "content/public/browser/web_contents_observer.h" |
| 16 #include "content/public/browser/web_contents_user_data.h" | 16 #include "content/public/browser/web_contents_user_data.h" |
| 17 #include "ui/gfx/geometry/size.h" | 17 #include "ui/gfx/geometry/size.h" |
| 18 | 18 |
| 19 class Profile; | 19 class Profile; |
| 20 | 20 |
| 21 namespace media_router { | |
| 22 class OffscreenPresentationManager; | |
| 23 } | |
| 24 | |
| 21 namespace extensions { | 25 namespace extensions { |
| 22 | 26 |
| 23 class OffscreenPresentation; // Forward declaration. See below. | 27 class OffscreenPresentation; // Forward declaration. See below. |
| 24 | 28 |
| 25 // Creates, owns, and manages all OffscreenPresentation instances created by the | 29 // Creates, owns, and manages all OffscreenPresentation instances created by the |
| 26 // same extension background page. When the extension background page's | 30 // same extension background page. When the extension background page's |
| 27 // WebContents is about to be destroyed, its associated | 31 // WebContents is about to be destroyed, its associated |
| 28 // OffscreenPresentationsOwner and all of its OffscreenPresentation instances | 32 // OffscreenPresentationsOwner and all of its OffscreenPresentation instances |
| 29 // are destroyed. | 33 // are destroyed. |
| 30 // | 34 // |
| (...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 171 | 175 |
| 172 private: | 176 private: |
| 173 bool in_fullscreen_mode() const { | 177 bool in_fullscreen_mode() const { |
| 174 return !non_fullscreen_size_.IsEmpty(); | 178 return !non_fullscreen_size_.IsEmpty(); |
| 175 } | 179 } |
| 176 | 180 |
| 177 // Called by |capture_poll_timer_| to automatically destroy this | 181 // Called by |capture_poll_timer_| to automatically destroy this |
| 178 // OffscreenPresentation when the capturer count returns to zero. | 182 // OffscreenPresentation when the capturer count returns to zero. |
| 179 void DieIfContentCaptureEnded(); | 183 void DieIfContentCaptureEnded(); |
| 180 | 184 |
| 185 // Unregisters this presentation from OffscreenPresentationManager and | |
| 186 // destroys it. | |
| 187 void Destroy(); | |
| 188 | |
| 189 // Gets the OffscreenPresentationManager instance associated with the | |
|
miu
2015/09/27 00:22:08
To be consistent with the naming and comments in t
imcheng
2015/09/30 01:13:41
Code removed.
| |
| 190 // presentation | |
| 191 // controller's BrowserContext. | |
| 192 media_router::OffscreenPresentationManager* GetOffscreenPresentationManager(); | |
| 193 | |
| 181 OffscreenPresentationsOwner* const owner_; | 194 OffscreenPresentationsOwner* const owner_; |
| 182 | 195 |
| 183 // The starting URL for this presentation, which may or may not match the | 196 // The starting URL for this presentation, which may or may not match the |
| 184 // current WebContents URL if navigations have occurred. | 197 // current WebContents URL if navigations have occurred. |
| 185 const GURL start_url_; | 198 const GURL start_url_; |
| 186 | 199 |
| 187 // The presentation ID used to help uniquely identify this instance. | 200 // The presentation ID used to help uniquely identify this instance. |
| 188 const std::string presentation_id_; | 201 const std::string presentation_id_; |
| 189 | 202 |
| 190 // A non-shared off-the-record profile based on the profile of the extension | 203 // A non-shared off-the-record profile based on the profile of the extension |
| (...skipping 20 matching lines...) Expand all Loading... | |
| 211 // This is false until after the Start() method is called, and capture of the | 224 // This is false until after the Start() method is called, and capture of the |
| 212 // |presentation_web_contents_| is first detected. | 225 // |presentation_web_contents_| is first detected. |
| 213 bool content_capture_was_detected_; | 226 bool content_capture_was_detected_; |
| 214 | 227 |
| 215 DISALLOW_COPY_AND_ASSIGN(OffscreenPresentation); | 228 DISALLOW_COPY_AND_ASSIGN(OffscreenPresentation); |
| 216 }; | 229 }; |
| 217 | 230 |
| 218 } // namespace extensions | 231 } // namespace extensions |
| 219 | 232 |
| 220 #endif // CHROME_BROWSER_EXTENSIONS_API_TAB_CAPTURE_OFFSCREEN_PRESENTATION_H_ | 233 #endif // CHROME_BROWSER_EXTENSIONS_API_TAB_CAPTURE_OFFSCREEN_PRESENTATION_H_ |
| OLD | NEW |