Commit efe8fd6a authored by Lukasz Suder's avatar Lukasz Suder Committed by Commit Bot

[Autofill Assistant] Displays error message on service error.

The default error message is displayed, when there is communication
problem.

Bug: 806868
Change-Id: Ic08594ce1b15535858b05d81406a5edac51150b5
Reviewed-on: https://chromium-review.googlesource.com/c/1256743
Commit-Queue: Lukasz Suder <lsuder@google.com>
Reviewed-by: default avatarJungshik Shin <jshin@chromium.org>
Reviewed-by: default avatarSylvain Defresne <sdefresne@chromium.org>
Reviewed-by: default avatarGanggui Tang <gogerald@chromium.org>
Cr-Commit-Position: refs/heads/master@{#601555}
parent 061b43d4
...@@ -83,6 +83,7 @@ jumbo_static_library("browser") { ...@@ -83,6 +83,7 @@ jumbo_static_library("browser") {
"//components/autofill/core/browser", "//components/autofill/core/browser",
"//components/autofill/core/common", "//components/autofill/core/common",
"//components/autofill_assistant/browser/devtools", "//components/autofill_assistant/browser/devtools",
"//components/strings:components_strings_grit",
"//components/version_info", "//components/version_info",
"//content/public/browser", "//content/public/browser",
"//google_apis", "//google_apis",
......
...@@ -4,9 +4,11 @@ include_rules = [ ...@@ -4,9 +4,11 @@ include_rules = [
"+content/public/browser", "+content/public/browser",
"+content/public/test", "+content/public/test",
"+content/shell/browser/shell.h", "+content/shell/browser/shell.h",
"+components/strings/grit/components_strings.h",
"+google_apis", "+google_apis",
"+net", "+net",
"+services/network/public/cpp", "+services/network/public/cpp",
"+third_party/blink/public/mojom/payments/payment_request.mojom.h", "+third_party/blink/public/mojom/payments/payment_request.mojom.h",
"+third_party/re2", "+third_party/re2",
"+ui/base/l10n/l10n_util.h",
] ]
...@@ -9,10 +9,12 @@ ...@@ -9,10 +9,12 @@
#include "base/task/post_task.h" #include "base/task/post_task.h"
#include "components/autofill_assistant/browser/protocol_utils.h" #include "components/autofill_assistant/browser/protocol_utils.h"
#include "components/autofill_assistant/browser/ui_controller.h" #include "components/autofill_assistant/browser/ui_controller.h"
#include "components/strings/grit/components_strings.h"
#include "content/public/browser/browser_task_traits.h" #include "content/public/browser/browser_task_traits.h"
#include "content/public/browser/browser_thread.h" #include "content/public/browser/browser_thread.h"
#include "content/public/browser/render_frame_host.h" #include "content/public/browser/render_frame_host.h"
#include "content/public/browser/web_contents.h" #include "content/public/browser/web_contents.h"
#include "ui/base/l10n/l10n_util.h"
#include "url/gurl.h" #include "url/gurl.h"
namespace autofill_assistant { namespace autofill_assistant {
...@@ -191,7 +193,9 @@ void Controller::OnScriptExecuted(const std::string& script_path, ...@@ -191,7 +193,9 @@ void Controller::OnScriptExecuted(const std::string& script_path,
GetUiController()->HideOverlay(); GetUiController()->HideOverlay();
if (!result.success) { if (!result.success) {
LOG(ERROR) << "Failed to execute script " << script_path; LOG(ERROR) << "Failed to execute script " << script_path;
// TODO(crbug.com/806868): Handle script execution failure. GetUiController()->ShowStatusMessage(
l10n_util::GetStringUTF8(IDS_AUTOFILL_ASSISTANT_DEFAULT_ERROR));
return;
} }
switch (result.at_end) { switch (result.at_end) {
......
<?xml version="1.0" encoding="utf-8"?>
<grit-part>
<if expr="is_android">
<message name="IDS_AUTOFILL_ASSISTANT_DEFAULT_ERROR" desc="Text label that is shown when communication with server fails.">
Service is not available. Try again later.
</message>
</if>
</grit-part>
...@@ -184,6 +184,7 @@ ...@@ -184,6 +184,7 @@
<messages fallback_to_english="true"> <messages fallback_to_english="true">
<part file="app_modal_strings.grdp" /> <part file="app_modal_strings.grdp" />
<part file="autofill_strings.grdp" /> <part file="autofill_strings.grdp" />
<part file="autofill_assistant_strings.grdp" />
<part file="bookmark_bar_strings.grdp" /> <part file="bookmark_bar_strings.grdp" />
<part file="bookmark_component_strings.grdp" /> <part file="bookmark_component_strings.grdp" />
<part file="browsing_data_strings.grdp" /> <part file="browsing_data_strings.grdp" />
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment