]> khamidou — GitHub mirrors - electron.git/commitdiff
Expose native implementation of WebContent::GetURL
authorCheng Zhao <zcbenz@gmail.com>
Tue, 15 Sep 2015 01:17:45 +0000 (09:17 +0800)
committerCheng Zhao <zcbenz@gmail.com>
Tue, 15 Sep 2015 01:18:14 +0000 (09:18 +0800)
atom/browser/api/atom_api_web_contents.cc
atom/browser/api/atom_api_web_contents.h

index 7c37f17e10d9592237c9048798f0d28e76d8bf04..a24200e5a87dda78de76670df714ccd054831f97 100644 (file)
@@ -547,6 +547,10 @@ void WebContents::LoadURL(const GURL& url, const mate::Dictionary& options) {
   web_contents()->GetController().LoadURLWithParams(params);
 }
 
+GURL WebContents::GetURL() const {
+  return web_contents()->GetURL();
+}
+
 base::string16 WebContents::GetTitle() const {
   return web_contents()->GetTitle();
 }
@@ -815,6 +819,7 @@ mate::ObjectTemplateBuilder WebContents::GetObjectTemplateBuilder(
         .SetMethod("getId", &WebContents::GetID)
         .SetMethod("equal", &WebContents::Equal)
         .SetMethod("_loadUrl", &WebContents::LoadURL)
+        .SetMethod("_getUrl", &WebContents::GetURL)
         .SetMethod("getTitle", &WebContents::GetTitle)
         .SetMethod("isLoading", &WebContents::IsLoading)
         .SetMethod("isWaitingForResponse", &WebContents::IsWaitingForResponse)
index 3c6bde9c24aa408448fd0473b86484f314922c9e..0001d3e8ef7544d99ddc65877d9ddf3346547d4a 100644 (file)
@@ -55,6 +55,7 @@ class WebContents : public mate::TrackableObject<WebContents>,
   int GetID() const;
   bool Equal(const WebContents* web_contents) const;
   void LoadURL(const GURL& url, const mate::Dictionary& options);
+  GURL GetURL() const;
   base::string16 GetTitle() const;
   bool IsLoading() const;
   bool IsWaitingForResponse() const;