diff options
Diffstat (limited to 'chrome/browser')
6 files changed, 0 insertions, 79 deletions
diff --git a/chrome/browser/renderer_host/render_view_host.cc b/chrome/browser/renderer_host/render_view_host.cc index 6bc23c6..0af74c3 100644 --- a/chrome/browser/renderer_host/render_view_host.cc +++ b/chrome/browser/renderer_host/render_view_host.cc @@ -781,8 +781,6 @@ void RenderViewHost::OnMessageReceived(const IPC::Message& msg) { IPC_MESSAGE_HANDLER(ViewHostMsg_UpdateDragCursor, OnUpdateDragCursor) IPC_MESSAGE_HANDLER(ViewHostMsg_TakeFocus, OnTakeFocus) IPC_MESSAGE_HANDLER(ViewHostMsg_PageHasOSDD, OnMsgPageHasOSDD) - IPC_MESSAGE_HANDLER_DELAY_REPLY(ViewHostMsg_GetSearchProviderInstallState, - OnMsgGetSearchProviderInstallState) IPC_MESSAGE_HANDLER(ViewHostMsg_DidGetPrintedPagesCount, OnDidGetPrintedPagesCount) IPC_MESSAGE_HANDLER(ViewHostMsg_DidPrintPage, DidPrintPage) @@ -1469,14 +1467,6 @@ void RenderViewHost::OnMsgPageHasOSDD(int32 page_id, const GURL& doc_url, delegate_->PageHasOSDD(this, page_id, doc_url, autodetected); } -void RenderViewHost::OnMsgGetSearchProviderInstallState( - const GURL& url, IPC::Message* reply_msg) { - ViewHostMsg_GetSearchProviderInstallState::WriteReplyParams( - reply_msg, - delegate_->GetSearchProviderInstallState(url)); - Send(reply_msg); -} - void RenderViewHost::OnDidGetPrintedPagesCount(int cookie, int number_pages) { RenderViewHostDelegate::Printing* printing_delegate = delegate_->GetPrintingDelegate(); diff --git a/chrome/browser/renderer_host/render_view_host.h b/chrome/browser/renderer_host/render_view_host.h index f296699..6dad785 100644 --- a/chrome/browser/renderer_host/render_view_host.h +++ b/chrome/browser/renderer_host/render_view_host.h @@ -587,8 +587,6 @@ class RenderViewHost : public RenderWidgetHost { void OnUpdateDragCursor(WebKit::WebDragOperation drag_operation); void OnTakeFocus(bool reverse); void OnMsgPageHasOSDD(int32 page_id, const GURL& doc_url, bool autodetected); - void OnMsgGetSearchProviderInstallState(const GURL& url, - IPC::Message* reply_msg); void OnDidGetPrintedPagesCount(int cookie, int number_pages); void DidPrintPage(const ViewHostMsg_DidPrintPage_Params& params); void OnAddMessageToConsole(const std::wstring& message, diff --git a/chrome/browser/renderer_host/render_view_host_delegate.cc b/chrome/browser/renderer_host/render_view_host_delegate.cc index c7b2aaa..00a6b48 100644 --- a/chrome/browser/renderer_host/render_view_host_delegate.cc +++ b/chrome/browser/renderer_host/render_view_host_delegate.cc @@ -95,11 +95,6 @@ GURL RenderViewHostDelegate::GetAlternateErrorPageURL() const { return GURL(); } -ViewHostMsg_GetSearchProviderInstallState_Params -RenderViewHostDelegate::GetSearchProviderInstallState(const GURL& url) { - return ViewHostMsg_GetSearchProviderInstallState_Params::Denied(); -} - WebPreferences RenderViewHostDelegate::GetWebkitPrefs() { return WebPreferences(); } diff --git a/chrome/browser/renderer_host/render_view_host_delegate.h b/chrome/browser/renderer_host/render_view_host_delegate.h index 51e5029..6ec1b8f 100644 --- a/chrome/browser/renderer_host/render_view_host_delegate.h +++ b/chrome/browser/renderer_host/render_view_host_delegate.h @@ -47,7 +47,6 @@ struct ThumbnailScore; struct ViewHostMsg_DidPrintPage_Params; struct ViewHostMsg_DomMessage_Params; struct ViewHostMsg_FrameNavigate_Params; -struct ViewHostMsg_GetSearchProviderInstallState_Params; struct ViewHostMsg_RunFileChooser_Params; struct WebDropData; class WebKeyboardEvent; @@ -759,11 +758,6 @@ class RenderViewHostDelegate { int32 page_id, const GURL& doc_url, bool autodetected) {} - // Returns the install state of the search provider url (not installed, - // installed, default). - virtual ViewHostMsg_GetSearchProviderInstallState_Params - GetSearchProviderInstallState(const GURL& url); - // |url| is assigned to a server that can provide alternate error pages. If // the returned URL is empty, the default error page built into WebKit will // be used. diff --git a/chrome/browser/tab_contents/tab_contents.cc b/chrome/browser/tab_contents/tab_contents.cc index 631bec9..d12434c 100644 --- a/chrome/browser/tab_contents/tab_contents.cc +++ b/chrome/browser/tab_contents/tab_contents.cc @@ -2797,60 +2797,6 @@ void TabContents::PageHasOSDD(RenderViewHost* render_view_host, autodetected); } -// Indicates if the two inputs have the same security origin. -// |requested_origin| should only be a security origin (no path, etc.). -// It is ok if |template_url| is NULL. -static bool IsSameOrigin(const GURL& requested_origin, - const TemplateURL* template_url) { - DCHECK(requested_origin == requested_origin.GetOrigin()); - return template_url && requested_origin == - TemplateURLModel::GenerateSearchURL(template_url).GetOrigin(); -} - -ViewHostMsg_GetSearchProviderInstallState_Params - TabContents::GetSearchProviderInstallState(const GURL& requested_host) { - // Get the last committed entry since that is the page executing the - // javascript as opposed to a page being navigated to. We don't want - // to trust the page to tell us the url to avoid using potentially - // compromised information. - NavigationEntry* entry = controller_.GetLastCommittedEntry(); - GURL page_origin = entry ? entry->virtual_url().GetOrigin() : GURL(); - GURL requested_origin = requested_host.GetOrigin(); - // Do the security check before any others to avoid information leaks. - if (page_origin != requested_origin) - return ViewHostMsg_GetSearchProviderInstallState_Params::Denied(); - - // In incognito mode, no search information is exposed. (This check must be - // done after the security check or else a web site can detect that the - // user is in incognito mode just by doing a cross origin request.) - if (profile()->IsOffTheRecord()) - return ViewHostMsg_GetSearchProviderInstallState_Params::NotInstalled(); - - TemplateURLModel* url_model = profile()->GetTemplateURLModel(); - if (!url_model) - return ViewHostMsg_GetSearchProviderInstallState_Params::NotInstalled(); - if (!url_model->loaded()) - url_model->Load(); - - // First check to see if the url is the default search provider. - if (IsSameOrigin(requested_origin, url_model->GetDefaultSearchProvider())) { - return ViewHostMsg_GetSearchProviderInstallState_Params:: - InstalledAsDefault(); - } - - // Is the url any search provider? - std::vector<const TemplateURL*> urls = url_model->GetTemplateURLs(); - for (std::vector<const TemplateURL*>::iterator i = urls.begin(); - i != urls.end(); ++i) { - const TemplateURL* template_url = (*i); - if (IsSameOrigin(requested_origin, template_url)) { - return ViewHostMsg_GetSearchProviderInstallState_Params:: - InstallButNotDefault(); - } - } - return ViewHostMsg_GetSearchProviderInstallState_Params::NotInstalled(); -} - GURL TabContents::GetAlternateErrorPageURL() const { GURL url; // Disable alternate error pages when in OffTheRecord/Incognito mode. diff --git a/chrome/browser/tab_contents/tab_contents.h b/chrome/browser/tab_contents/tab_contents.h index 41d298a..4fafde2 100644 --- a/chrome/browser/tab_contents/tab_contents.h +++ b/chrome/browser/tab_contents/tab_contents.h @@ -943,8 +943,6 @@ class TabContents : public PageNavigator, const std::vector<webkit_glue::PasswordForm>& visible_forms); virtual void PageHasOSDD(RenderViewHost* render_view_host, int32 page_id, const GURL& url, bool autodetected); - virtual ViewHostMsg_GetSearchProviderInstallState_Params - GetSearchProviderInstallState(const GURL& url); virtual GURL GetAlternateErrorPageURL() const; virtual RendererPreferences GetRendererPrefs(Profile* profile) const; virtual WebPreferences GetWebkitPrefs(); |