return web_contents() != NULL;
}
+int WebContents::GetID() const {
+ return web_contents()->GetRenderProcessHost()->GetID();
+}
+
+bool WebContents::Equal(const WebContents* web_contents) const {
+ return GetID() == web_contents->GetID();
+}
+
void WebContents::LoadURL(const GURL& url, const mate::Dictionary& options) {
content::NavigationController::LoadURLParams params(url);
web_contents()->GetController().GoToOffset(offset);
}
-int WebContents::GetRoutingID() const {
- return web_contents()->GetRoutingID();
-}
-
-int WebContents::GetProcessID() const {
- return web_contents()->GetRenderProcessHost()->GetID();
-}
-
bool WebContents::IsCrashed() const {
return web_contents()->IsCrashed();
}
template_.Reset(isolate, mate::ObjectTemplateBuilder(isolate)
.SetMethod("destroy", &WebContents::Destroy)
.SetMethod("isAlive", &WebContents::IsAlive)
+ .SetMethod("getId", &WebContents::GetID)
+ .SetMethod("equal", &WebContents::Equal)
.SetMethod("_loadUrl", &WebContents::LoadURL)
.SetMethod("getTitle", &WebContents::GetTitle)
.SetMethod("isLoading", &WebContents::IsLoading)
.SetMethod("_goBack", &WebContents::GoBack)
.SetMethod("_goForward", &WebContents::GoForward)
.SetMethod("_goToOffset", &WebContents::GoToOffset)
- .SetMethod("getRoutingId", &WebContents::GetRoutingID)
- .SetMethod("getProcessId", &WebContents::GetProcessID)
.SetMethod("isCrashed", &WebContents::IsCrashed)
.SetMethod("setUserAgent", &WebContents::SetUserAgent)
.SetMethod("insertCSS", &WebContents::InsertCSS)
void Destroy();
bool IsAlive() const;
+ int GetID() const;
+ bool Equal(const WebContents* web_contents) const;
void LoadURL(const GURL& url, const mate::Dictionary& options);
base::string16 GetTitle() const;
bool IsLoading() const;
void GoBack();
void GoForward();
void GoToOffset(int offset);
- int GetRoutingID() const;
- int GetProcessID() const;
bool IsCrashed() const;
void SetUserAgent(const std::string& user_agent);
void InsertCSS(const std::string& css);
else
webContents.once 'did-finish-load', @_executeJavaScript.bind(this, code)
- # The processId and routingId and identify a webContents.
- webContents.getId = -> @getProcessId()
- webContents.equal = (other) -> @getId() is other.getId()
-
# The navigation controller.
controller = new NavigationController(webContents)
for name, method of NavigationController.prototype when method instanceof Function