Skip to content
This repository has been archived by the owner on Jan 4, 2019. It is now read-only.

Commit

Permalink
Explicitly calling ExtensionWebContentsObserver::Initialize
Browse files Browse the repository at this point in the history
  • Loading branch information
darkdh committed May 29, 2018
1 parent 7c92450 commit 56d6356
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,15 @@ AtomExtensionWebContentsObserver::AtomExtensionWebContentsObserver(

AtomExtensionWebContentsObserver::~AtomExtensionWebContentsObserver() {}

void AtomExtensionWebContentsObserver::CreateForWebContents(
content::WebContents* web_contents) {
content::WebContentsUserData<
AtomExtensionWebContentsObserver>::CreateForWebContents(web_contents);

// Initialize this instance if necessary.
FromWebContents(web_contents)->Initialize();
}

void AtomExtensionWebContentsObserver::RenderFrameCreated(
content::RenderFrameHost* render_frame_host) {
ExtensionWebContentsObserver::RenderFrameCreated(render_frame_host);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@ class AtomExtensionWebContentsObserver
public:
~AtomExtensionWebContentsObserver() override;

// Creates and initializes an instance of this class for the given
// |web_contents|, if it doesn't already exist.
static void CreateForWebContents(content::WebContents* web_contents);

private:
friend class content::WebContentsUserData<AtomExtensionWebContentsObserver>;

Expand Down

0 comments on commit 56d6356

Please sign in to comment.