| Index: chrome/renderer/external_extension.cc
|
| ===================================================================
|
| --- chrome/renderer/external_extension.cc (revision 81920)
|
| +++ chrome/renderer/external_extension.cc (working copy)
|
| @@ -6,9 +6,11 @@
|
|
|
| #include "base/command_line.h"
|
| #include "chrome/common/chrome_switches.h"
|
| +#include "chrome/common/render_messages.h"
|
| #include "chrome/common/search_provider.h"
|
| #include "content/renderer/render_view.h"
|
| #include "third_party/WebKit/Source/WebKit/chromium/public/WebFrame.h"
|
| +#include "third_party/WebKit/Source/WebKit/chromium/public/WebView.h"
|
| #include "v8/include/v8.h"
|
|
|
| using WebKit::WebFrame;
|
| @@ -124,7 +126,16 @@
|
| RenderView* render_view = GetRenderView();
|
| if (!render_view) return v8::Undefined();
|
|
|
| - render_view->AddSearchProvider(name, provider_type);
|
| + if (provider_type != search_provider::EXPLICIT_DEFAULT_PROVIDER ||
|
| + render_view->webview()->mainFrame()->isProcessingUserGesture()) {
|
| + GURL osd_url(name);
|
| + if (!osd_url.is_empty()) {
|
| + render_view->Send(new ViewHostMsg_PageHasOSDD(
|
| + render_view->routing_id(), render_view->page_id(), osd_url,
|
| + provider_type));
|
| + }
|
| + }
|
| +
|
| return v8::Undefined();
|
| }
|
|
|
| @@ -142,8 +153,13 @@
|
| WebFrame* webframe = WebFrame::frameForEnteredContext();
|
| if (!webframe) return v8::Undefined();
|
|
|
| - search_provider::InstallState install =
|
| - render_view->GetSearchProviderInstallState(webframe, name);
|
| + search_provider::InstallState install = search_provider::DENIED;
|
| + GURL inquiry_url = GURL(name);
|
| + if (!inquiry_url.is_empty()) {
|
| + render_view->Send(new ViewHostMsg_GetSearchProviderInstallState(
|
| + render_view->routing_id(), webframe->url(), inquiry_url, &install));
|
| + }
|
| +
|
| if (install == search_provider::DENIED) {
|
| // FIXME: throw access denied exception.
|
| return v8::ThrowException(v8::Exception::Error(v8::String::Empty()));
|
|
|