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

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: Response to review 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 095822cb32c9a9e884a0f55bd845026818be2dfa..808ea4f5a53adad1e75402ff350d54b8d20cb0eb 100644
--- a/components/autofill/content/browser/autofill_driver_impl.cc
+++ b/components/autofill/content/browser/autofill_driver_impl.cc
@@ -9,6 +9,7 @@
#include "components/autofill/core/browser/autofill_manager_delegate.h"
#include "components/autofill/core/common/autofill_messages.h"
#include "content/public/browser/navigation_details.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"
@@ -68,6 +69,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