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

Unified Diff: components/autofill/content/browser/autofill_driver_impl.cc

Issue 17572015: Begin abstracting sending of IPC from autofill core code. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 7 years, 6 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: components/autofill/content/browser/autofill_driver_impl.cc
diff --git a/components/autofill/content/browser/autofill_driver_impl.cc b/components/autofill/content/browser/autofill_driver_impl.cc
index 713bee7d4c7dfe7e3b245a98f077f50f89b644cd..2cc9c25567cc6e8d0589306f9d5f58dad90a7d76 100644
--- a/components/autofill/content/browser/autofill_driver_impl.cc
+++ b/components/autofill/content/browser/autofill_driver_impl.cc
@@ -13,6 +13,7 @@
#include "content/public/browser/notification_service.h"
#include "content/public/browser/notification_source.h"
#include "content/public/browser/notification_types.h"
+#include "content/public/browser/render_view_host.h"
#include "content/public/browser/web_contents.h"
#include "content/public/common/frame_navigate_params.h"
#include "ipc/ipc_message_macros.h"
@@ -81,6 +82,19 @@ content::WebContents* AutofillDriverImpl::GetWebContents() {
return web_contents();
}
+bool AutofillDriverImpl::RendererIsAvailable() {
+ return (web_contents()->GetRenderViewHost() != NULL);
+}
+
+void AutofillDriverImpl::SendFormDataToRenderer(int query_id,
+ const FormData& data) {
+ if (!RendererIsAvailable())
+ return;
+ content::RenderViewHost* host = web_contents()->GetRenderViewHost();
+ host->Send(
+ new AutofillMsg_FormDataFilled(host->GetRoutingID(), query_id, data));
+}
+
bool AutofillDriverImpl::OnMessageReceived(const IPC::Message& message) {
bool handled = true;
IPC_BEGIN_MESSAGE_MAP(AutofillDriverImpl, message)

Powered by Google App Engine
This is Rietveld 408576698