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

Unified Diff: chrome/browser/background/background_contents.h

Issue 955713004: Merge 317853 - Make BackgroundContentsService start up BackgroundContents with a delay, as for Exte… (Closed) Base URL: https://chromium.googlesource.com/chromium/src@2311
Patch Set: Created 5 years, 10 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/background/background_contents.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/background/background_contents.h
diff --git a/chrome/browser/background/background_contents.h b/chrome/browser/background/background_contents.h
index e7345e344c7c6572da0f1e721f105d6c3e941742..b4a94c4f55819f21b819378302021034d398d263 100644
--- a/chrome/browser/background/background_contents.h
+++ b/chrome/browser/background/background_contents.h
@@ -12,7 +12,9 @@
#include "content/public/browser/notification_registrar.h"
#include "content/public/browser/web_contents_delegate.h"
#include "content/public/browser/web_contents_observer.h"
+#include "extensions/browser/deferred_start_render_host.h"
#include "ui/base/window_open_disposition.h"
+#include "url/gurl.h"
class Profile;
@@ -21,10 +23,15 @@ class SessionStorageNamespace;
class SiteInstance;
};
+namespace extensions {
+class ExtensionHostDelegate;
+}
+
// This class maintains a WebContents used in the background. It can host a
// renderer, but does not have any visible display.
// TODO(atwilson): Unify this with background pages; http://crbug.com/77790
-class BackgroundContents : public content::WebContentsDelegate,
+class BackgroundContents : public extensions::DeferredStartRenderHost,
+ public content::WebContentsDelegate,
public content::WebContentsObserver,
public content::NotificationObserver {
public:
@@ -56,6 +63,9 @@ class BackgroundContents : public content::WebContentsDelegate,
content::WebContents* web_contents() const { return web_contents_.get(); }
virtual const GURL& GetURL() const;
+ // Adds this BackgroundContents to the queue of RenderViews to create.
+ void CreateRenderViewSoon(const GURL& url);
+
// content::WebContentsDelegate implementation:
void CloseContents(content::WebContents* source) override;
bool ShouldSuppressDialogs(content::WebContents* source) override;
@@ -81,13 +91,22 @@ class BackgroundContents : public content::WebContentsDelegate,
BackgroundContents();
private:
+ // DeferredStartRenderHost implementation:
+ void CreateRenderViewNow() override;
+
// The delegate for this BackgroundContents.
Delegate* delegate_;
+ // Delegate for choosing an ExtensionHostQueue.
+ scoped_ptr<extensions::ExtensionHostDelegate> extension_host_delegate_;
+
Profile* profile_;
scoped_ptr<content::WebContents> web_contents_;
content::NotificationRegistrar registrar_;
+ // The initial URL to load.
+ GURL initial_url_;
+
DISALLOW_COPY_AND_ASSIGN(BackgroundContents);
};
« no previous file with comments | « no previous file | chrome/browser/background/background_contents.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698