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> |
11 #include <vector> | 11 #include <vector> |
12 | 12 |
13 #include "base/macros.h" | 13 #include "base/macros.h" |
14 #include "base/memory/scoped_vector.h" | |
15 #include "base/time/time.h" | 14 #include "base/time/time.h" |
16 #include "base/timer/timer.h" | 15 #include "base/timer/timer.h" |
17 #include "content/public/browser/web_contents_delegate.h" | 16 #include "content/public/browser/web_contents_delegate.h" |
18 #include "content/public/browser/web_contents_observer.h" | 17 #include "content/public/browser/web_contents_observer.h" |
19 #include "content/public/browser/web_contents_user_data.h" | 18 #include "content/public/browser/web_contents_user_data.h" |
20 #include "ui/gfx/geometry/size.h" | 19 #include "ui/gfx/geometry/size.h" |
21 | 20 |
22 class Profile; | 21 class Profile; |
23 | 22 |
24 namespace extensions { | 23 namespace extensions { |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
68 | 67 |
69 // Shuts down and destroys the |tab|. | 68 // Shuts down and destroys the |tab|. |
70 void DestroyTab(OffscreenTab* tab); | 69 void DestroyTab(OffscreenTab* tab); |
71 | 70 |
72 private: | 71 private: |
73 friend class content::WebContentsUserData<OffscreenTabsOwner>; | 72 friend class content::WebContentsUserData<OffscreenTabsOwner>; |
74 | 73 |
75 explicit OffscreenTabsOwner(content::WebContents* extension_web_contents); | 74 explicit OffscreenTabsOwner(content::WebContents* extension_web_contents); |
76 | 75 |
77 content::WebContents* const extension_web_contents_; | 76 content::WebContents* const extension_web_contents_; |
78 ScopedVector<OffscreenTab> tabs_; | 77 std::vector<std::unique_ptr<OffscreenTab>> tabs_; |
79 | 78 |
80 DISALLOW_COPY_AND_ASSIGN(OffscreenTabsOwner); | 79 DISALLOW_COPY_AND_ASSIGN(OffscreenTabsOwner); |
81 }; | 80 }; |
82 | 81 |
83 // Owns and controls a sandboxed WebContents instance hosting the rendering | 82 // Owns and controls a sandboxed WebContents instance hosting the rendering |
84 // engine for an offscreen tab. Since the offscreen tab does not interact with | 83 // engine for an offscreen tab. Since the offscreen tab does not interact with |
85 // the user in any direct way, the WebContents is not attached to any Browser | 84 // the user in any direct way, the WebContents is not attached to any Browser |
86 // window/UI, and any input and focusing capabilities are blocked. | 85 // window/UI, and any input and focusing capabilities are blocked. |
87 // | 86 // |
88 // OffscreenTab is instantiated by OffscreenTabsOwner. An instance is shut down | 87 // OffscreenTab is instantiated by OffscreenTabsOwner. An instance is shut down |
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
210 // This is false until after the Start() method is called, and capture of the | 209 // This is false until after the Start() method is called, and capture of the |
211 // |offscreen_tab_web_contents_| is first detected. | 210 // |offscreen_tab_web_contents_| is first detected. |
212 bool content_capture_was_detected_; | 211 bool content_capture_was_detected_; |
213 | 212 |
214 DISALLOW_COPY_AND_ASSIGN(OffscreenTab); | 213 DISALLOW_COPY_AND_ASSIGN(OffscreenTab); |
215 }; | 214 }; |
216 | 215 |
217 } // namespace extensions | 216 } // namespace extensions |
218 | 217 |
219 #endif // CHROME_BROWSER_EXTENSIONS_API_TAB_CAPTURE_OFFSCREEN_TAB_H_ | 218 #endif // CHROME_BROWSER_EXTENSIONS_API_TAB_CAPTURE_OFFSCREEN_TAB_H_ |
OLD | NEW |