Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1042)

Unified Diff: chrome/renderer/external_extension.cc

Issue 6874038: Remove the last Chrome dependencies from renderer, and enforce no more includes through DEPS. I ... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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()));

Powered by Google App Engine
This is Rietveld 408576698