### Preflight Checklist
* [x] I have read the [Contributing Guidelines](https://github.com/electron/electron/blob/master/CONTRIBUTING.md) for this project.
* [x] I agree to follow the [Code of Conduct](https://github.com/electron/electron/blob/master/CODE_OF_CONDUCT.md) that this project adheres to.
* [x] I have searched the issue tracker for an issue that matches the one I want to file, without success.

### Issue Details

* **Electron Version:** 5.0.7
* **Operating System:** Windows 10

### Expected Behavior
I expect that calling `BrowserWindow.fromWebContents(win.webContents)` returns `win`.

### Actual Behavior
The API returns `undefined`.

### To Reproduce
```
const { app, BrowserWindow } = require('electron')

async function createWindow() {
  var mainWindow = new BrowserWindow({
    webPreferences: {
      nativeWindowOpen: true
    }
  });
  await mainWindow.loadURL("https://google.com");
  mainWindow.webContents.openDevTools();
  console.log(BrowserWindow.fromWebContents(mainWindow.webContents)); // correctly returns mainWindow

  app.on("browser-window-created", (e, window) => {
    console.log(BrowserWindow.fromWebContents(window.webContents)); // returns undefined
    window.once("will-move", (e) => {
      console.log(BrowserWindow.fromWebContents(e.sender)); // extra test; also returns undefined
    });
  });
}

app.on('ready', createWindow)
```

Run `npm start` and open a window from devtools (e.g. `window.open("https://google.com")`). Notice that `fromWebContents` can't find the browser window for the new window.
shell/common/gin_helper/trackable_object.h
if (weak_map_ && weak_map_->Has(weak_map_id()))
      weak_map_->Remove(weak_map_id());
  }
 protected:
  TrackableObject() { weak_map_id_ = ++next_id_; }
  ~TrackableObject() override { RemoveFromWeakMap(); }
  void InitWith(v8::Isolate* isolate, v8::Local<v8::Object> wrapper) override {
    gin_helper::WrappableBase::InitWith(isolate, wrapper);
    if (!weak_map_) {
      weak_map_ = new electron::KeyWeakMap<int32_t>;
    }
    weak_map_->Set(isolate, weak_map_id_, wrapper);
  }
 private:
  static int32_t next_id_;
  static electron::KeyWeakMap<int32_t>* weak_map_;  
};
template <typename T>
int32_t TrackableObject<T>::next_id_ = 0;
template <typename T>
electron::KeyWeakMap<int32_t>* TrackableObject<T>::weak_map_ = nullptr;
}  
#endif