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

Side by Side Diff: chrome/browser/extensions/api/tab_capture/offscreen_tab.h

Issue 2846413002: Switch SupportsUserData uses to use unique_ptr. (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
OLDNEW
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 18 matching lines...) Expand all
29 // is about to be destroyed, its associated OffscreenTabsOwner and all of its 29 // is about to be destroyed, its associated OffscreenTabsOwner and all of its
30 // OffscreenTab instances are destroyed. 30 // OffscreenTab instances are destroyed.
31 // 31 //
32 // Usage: 32 // Usage:
33 // 33 //
34 // OffscreenTabsOwner::Get(extension_contents) 34 // OffscreenTabsOwner::Get(extension_contents)
35 // ->OpenNewTab(start_url, size, std::string()); 35 // ->OpenNewTab(start_url, size, std::string());
36 // 36 //
37 // This class operates exclusively on the UI thread and so is not thread-safe. 37 // This class operates exclusively on the UI thread and so is not thread-safe.
38 class OffscreenTabsOwner 38 class OffscreenTabsOwner
39 : protected content::WebContentsUserData<OffscreenTabsOwner> { 39 : public content::WebContentsUserData<OffscreenTabsOwner> {
40 public: 40 public:
41 ~OffscreenTabsOwner() final; 41 ~OffscreenTabsOwner() final;
42 42
43 // Returns the OffscreenTabsOwner instance associated with the given extension 43 // Returns the OffscreenTabsOwner instance associated with the given extension
44 // background page's WebContents. Never returns nullptr. 44 // background page's WebContents. Never returns nullptr.
45 static OffscreenTabsOwner* Get(content::WebContents* extension_web_contents); 45 static OffscreenTabsOwner* Get(content::WebContents* extension_web_contents);
46 46
47 // Instantiate a new offscreen tab and navigate it to |start_url|. The new 47 // Instantiate a new offscreen tab and navigate it to |start_url|. The new
48 // tab's main frame will start out with the given |initial_size| in DIP 48 // tab's main frame will start out with the given |initial_size| in DIP
49 // coordinates. If too many offscreen tabs are already running, nothing 49 // coordinates. If too many offscreen tabs are already running, nothing
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after
211 // This is false until after the Start() method is called, and capture of the 211 // This is false until after the Start() method is called, and capture of the
212 // |offscreen_tab_web_contents_| is first detected. 212 // |offscreen_tab_web_contents_| is first detected.
213 bool content_capture_was_detected_; 213 bool content_capture_was_detected_;
214 214
215 DISALLOW_COPY_AND_ASSIGN(OffscreenTab); 215 DISALLOW_COPY_AND_ASSIGN(OffscreenTab);
216 }; 216 };
217 217
218 } // namespace extensions 218 } // namespace extensions
219 219
220 #endif // CHROME_BROWSER_EXTENSIONS_API_TAB_CAPTURE_OFFSCREEN_TAB_H_ 220 #endif // CHROME_BROWSER_EXTENSIONS_API_TAB_CAPTURE_OFFSCREEN_TAB_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698