Commit 6a9a923a authored by David Black's avatar David Black Committed by Commit Bot

Pass device locale to proactive suggestions service.

The proactive suggestions service needs locale to support I18N.

Bug: b:140108241
Change-Id: I18a651cb61cc1c4bf37eeae95833a9fdc6229f4b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1769684Reviewed-by: default avatarXiaohui Chen <xiaohuic@chromium.org>
Commit-Queue: David Black <dmblack@google.com>
Cr-Commit-Position: refs/heads/master@{#690963}
parent c2961e7c
......@@ -5,6 +5,7 @@
#include "chrome/browser/ui/ash/assistant/proactive_suggestions_loader.h"
#include "ash/public/cpp/assistant/proactive_suggestions.h"
#include "base/i18n/rtl.h"
#include "chrome/browser/profiles/profile.h"
#include "content/public/browser/browser_context.h"
#include "content/public/browser/storage_partition.h"
......@@ -39,9 +40,16 @@ constexpr net::NetworkTrafficAnnotationTag kNetworkTrafficAnnotationTag =
GURL CreateProactiveSuggestionsUrl(const GURL& url) {
static constexpr char kProactiveSuggestionsEndpoint[] =
"https://assistant.google.com/proactivesuggestions/embeddedview";
GURL result = GURL(kProactiveSuggestionsEndpoint);
// The proactive suggestions service needs to be aware of the device locale.
static constexpr char kLocaleParamKey[] = "hl";
result = net::AppendOrReplaceQueryParameter(
result, kLocaleParamKey, base::i18n::GetConfiguredLocale());
// The proactive suggestions service needs to be informed of the given |url|.
static constexpr char kUrlParamKey[] = "url";
return net::AppendOrReplaceQueryParameter(GURL(kProactiveSuggestionsEndpoint),
kUrlParamKey, url.spec());
return net::AppendOrReplaceQueryParameter(result, kUrlParamKey, url.spec());
}
// Parses proactive suggestions metadata from the specified |headers|.
......
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