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

Unified Diff: components/autofill/content/renderer/autofill_agent.cc

Issue 232263002: Console logging for rAc developer errors. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: platforms Created 6 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: components/autofill/content/renderer/autofill_agent.cc
diff --git a/components/autofill/content/renderer/autofill_agent.cc b/components/autofill/content/renderer/autofill_agent.cc
index b07457e3c13e9450718373c94174354cae97cc50..a7d75c847776b8952e1dfcade632aa1001a5dcc1 100644
--- a/components/autofill/content/renderer/autofill_agent.cc
+++ b/components/autofill/content/renderer/autofill_agent.cc
@@ -32,6 +32,7 @@
#include "net/cert/cert_status_flags.h"
#include "third_party/WebKit/public/platform/WebRect.h"
#include "third_party/WebKit/public/platform/WebURLRequest.h"
+#include "third_party/WebKit/public/web/WebConsoleMessage.h"
#include "third_party/WebKit/public/web/WebDataSource.h"
#include "third_party/WebKit/public/web/WebDocument.h"
#include "third_party/WebKit/public/web/WebElementCollection.h"
@@ -47,6 +48,7 @@
#include "ui/events/keycodes/keyboard_codes.h"
using blink::WebAutofillClient;
+using blink::WebConsoleMessage;
using blink::WebElement;
using blink::WebElementCollection;
using blink::WebFormControlElement;
@@ -504,6 +506,7 @@ void AutofillAgent::OnAcceptPasswordAutofillSuggestion(
void AutofillAgent::OnRequestAutocompleteResult(
WebFormElement::AutocompleteResult result,
+ const base::string16& message,
const FormData& form_data) {
if (in_flight_request_form_.isNull())
return;
@@ -515,6 +518,15 @@ void AutofillAgent::OnRequestAutocompleteResult(
}
in_flight_request_form_.finishRequestAutocomplete(result);
+
+ if (!message.empty()) {
+ const base::string16 prefix(base::ASCIIToUTF16("requestAutocomplete: "));
+ WebConsoleMessage console_message = WebConsoleMessage(
+ WebConsoleMessage::LevelLog, WebString(prefix + message));
+ in_flight_request_form_.document().frame()->addMessageToConsole(
+ console_message);
+ }
+
in_flight_request_form_.reset();
}
« no previous file with comments | « components/autofill/content/renderer/autofill_agent.h ('k') | components/autofill/core/browser/autofill_manager_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698