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

Unified Diff: chrome/browser/extensions/api/tab_capture/offscreen_presentation.h

Issue 1221483002: New tabCapture.captureOffscreenTab API, initially for Presentation API 1UA mode (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Mostly revert to Patch Set 6, plus minor tweaks. [and REBASE] Created 5 years, 2 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/browser/extensions/api/tab_capture/offscreen_presentation.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/api/tab_capture/offscreen_presentation.h
diff --git a/chrome/browser/extensions/api/tab_capture/offscreen_presentation.h b/chrome/browser/extensions/api/tab_capture/offscreen_presentation.h
index 03ca5c22810b3cbf2daf8cb9073895912bec0fe8..6efa29468558849173f63e340480a858611a4fdc 100644
--- a/chrome/browser/extensions/api/tab_capture/offscreen_presentation.h
+++ b/chrome/browser/extensions/api/tab_capture/offscreen_presentation.h
@@ -20,6 +20,9 @@ class Profile;
namespace extensions {
+// TODO(miu): This file and classes should be renamed, as this implementation
+// has expanded in scope to be used for all off-screen tabs.
+
class OffscreenPresentation; // Forward declaration. See below.
// Creates, owns, and manages all OffscreenPresentation instances created by the
@@ -31,7 +34,7 @@ class OffscreenPresentation; // Forward declaration. See below.
// Usage:
//
// OffscreenPresentationsOwner::Get(extension_contents)
-// ->FindOrStartPresentation(start_url, presentation_id, size);
+// ->StartPresentation(start_url, presentation_id, size);
//
// This class operates exclusively on the UI thread and so is not thread-safe.
class OffscreenPresentationsOwner
@@ -44,12 +47,14 @@ class OffscreenPresentationsOwner
static OffscreenPresentationsOwner* Get(
content::WebContents* extension_web_contents);
- // Find a presentation, keyed by |start_url| and |presentation_id|. If found,
- // return it. Otherwise, instantiate a new one and return that. If too many
- // presentations have already been started, this method returns nullptr.
- OffscreenPresentation* FindOrStartPresentation(
+ // Instantiate a new off-screen tab, navigate it to |start_url|, and register
+ // it with the presentation router using |presentation_id| (if a non-empty
+ // string). The new tab's main frame will start out with the given
+ // |initial_size| in DIP coordinates. If too many off-screen tabs have
+ // already been started, this method returns nullptr.
+ OffscreenPresentation* StartPresentation(
const GURL& start_url,
- const std::string& presentation_id,
+ const std::string& optional_presentation_id,
const gfx::Size& initial_size);
protected:
@@ -68,11 +73,6 @@ class OffscreenPresentationsOwner
explicit OffscreenPresentationsOwner(content::WebContents* contents);
- // Returns the OffscreenPresentation that matches the given |start_url| and
- // |presentation_id|, or nullptr if not found.
- OffscreenPresentation* FindPresentation(
- const GURL& start_url, const std::string& presentation_id) const;
-
content::WebContents* const extension_web_contents_;
ScopedVector<OffscreenPresentation> presentations_;
« no previous file with comments | « no previous file | chrome/browser/extensions/api/tab_capture/offscreen_presentation.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698