From 22c50d0800b57289fd161b8fb3a0330ee6238862 Mon Sep 17 00:00:00 2001 From: deepak1556 Date: Mon, 4 May 2015 13:39:13 +0530 Subject: [PATCH] webContents: removing getFavicon api --- atom/browser/api/atom_api_web_contents.cc | 8 -------- atom/browser/api/atom_api_web_contents.h | 1 - atom/renderer/lib/web-view/web-view.coffee | 7 ------- docs/api/browser-window.md | 4 ---- docs/api/web-view-tag.md | 4 ---- 5 files changed, 24 deletions(-) diff --git a/atom/browser/api/atom_api_web_contents.cc b/atom/browser/api/atom_api_web_contents.cc index f13127c..c998dec 100644 --- a/atom/browser/api/atom_api_web_contents.cc +++ b/atom/browser/api/atom_api_web_contents.cc @@ -426,13 +426,6 @@ base::string16 WebContents::GetTitle() const { return web_contents()->GetTitle(); } -gfx::Image WebContents::GetFavicon() const { - auto entry = web_contents()->GetController().GetLastCommittedEntry(); - if (!entry) - return gfx::Image(); - return entry->GetFavicon().image; -} - bool WebContents::IsLoading() const { return web_contents()->IsLoading(); } @@ -613,7 +606,6 @@ mate::ObjectTemplateBuilder WebContents::GetObjectTemplateBuilder( .SetMethod("isAlive", &WebContents::IsAlive) .SetMethod("_loadUrl", &WebContents::LoadURL) .SetMethod("getTitle", &WebContents::GetTitle) - .SetMethod("getFavicon", &WebContents::GetFavicon) .SetMethod("isLoading", &WebContents::IsLoading) .SetMethod("isWaitingForResponse", &WebContents::IsWaitingForResponse) .SetMethod("_stop", &WebContents::Stop) diff --git a/atom/browser/api/atom_api_web_contents.h b/atom/browser/api/atom_api_web_contents.h index 1925a96..cc2fd30 100644 --- a/atom/browser/api/atom_api_web_contents.h +++ b/atom/browser/api/atom_api_web_contents.h @@ -49,7 +49,6 @@ class WebContents : public mate::EventEmitter, bool IsAlive() const; void LoadURL(const GURL& url, const mate::Dictionary& options); base::string16 GetTitle() const; - gfx::Image GetFavicon() const; bool IsLoading() const; bool IsWaitingForResponse() const; void Stop(); diff --git a/atom/renderer/lib/web-view/web-view.coffee b/atom/renderer/lib/web-view/web-view.coffee index 8641151..bf163c0 100644 --- a/atom/renderer/lib/web-view/web-view.coffee +++ b/atom/renderer/lib/web-view/web-view.coffee @@ -277,13 +277,6 @@ registerWebViewElement = -> remote.getGuestWebContents(internal.guestInstanceId)[m] args... proto[m] = createHandler m for m in methods - # Return dataUrl instead of nativeImage. - proto.getFavicon = (args...) -> - internal = v8Util.getHiddenValue this, 'internal' - return unless internal - favicon = remote.getGuestWebContents(internal.guestInstanceId)['getFavicon'] args... - favicon.toDataUrl() - window.WebView = webFrame.registerEmbedderCustomElement 'webview', prototype: proto diff --git a/docs/api/browser-window.md b/docs/api/browser-window.md index 44021ca..b1023db 100644 --- a/docs/api/browser-window.md +++ b/docs/api/browser-window.md @@ -741,10 +741,6 @@ Returns URL of current web page. Returns the title of web page. -### WebContents.getFavicon() - -Returns the favicon of web page as [NativeImage](native-image.md). - ### WebContents.isLoading() Returns whether web page is still loading resources. diff --git a/docs/api/web-view-tag.md b/docs/api/web-view-tag.md index 697860c..89ae678 100644 --- a/docs/api/web-view-tag.md +++ b/docs/api/web-view-tag.md @@ -130,10 +130,6 @@ Returns URL of guest page. Returns the title of guest page. -### ``.getFavicon() - -Returns the favicon of guest page as dataUrl. - ### ``.isLoading() Returns whether guest page is still loading resources. -- 2.7.4