Increase proactive suggestions chip max width.

Per discussion with UX, increasing max width from 240dp to 280dp and
making configurable in case feedback indicates we need to adjust this
value further.

Bug: b:140649426
Change-Id: I82d89ad96df5d0a9e4e1028fc8bd8fb291cd1f43
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1793788
Commit-Queue: David Black <dmblack@google.com>
Reviewed-by: Xiaohui Chen <xiaohuic@chromium.org>
Reviewed-by: Tao Wu <wutao@chromium.org>
Cr-Commit-Position: refs/heads/master@{#696094}
diff --git a/ash/assistant/ui/proactive_suggestions_view.cc b/ash/assistant/ui/proactive_suggestions_view.cc
index 7dd4bf3..3539f0c 100644
--- a/ash/assistant/ui/proactive_suggestions_view.cc
+++ b/ash/assistant/ui/proactive_suggestions_view.cc
@@ -11,6 +11,7 @@
 #include "ash/public/cpp/assistant/proactive_suggestions.h"
 #include "ash/resources/vector_icons/vector_icons.h"
 #include "base/strings/utf_string_conversions.h"
+#include "chromeos/services/assistant/public/features.h"
 #include "net/base/escape.h"
 #include "ui/display/screen.h"
 #include "ui/gfx/canvas.h"
@@ -33,7 +34,6 @@
 constexpr int kCloseButtonIconSizeDip = 16;
 constexpr int kCloseButtonSizeDip = 32;
 constexpr int kLineHeightDip = 20;
-constexpr int kMaxWidthDip = 240;
 constexpr int kPaddingLeftDip = 8;
 constexpr int kPaddingRightDip = 0;
 constexpr int kPreferredHeightDip = 32;
@@ -63,7 +63,9 @@
 
 gfx::Size ProactiveSuggestionsView::CalculatePreferredSize() const {
   int preferred_width = views::View::CalculatePreferredSize().width();
-  preferred_width = std::min(preferred_width, kMaxWidthDip);
+  preferred_width = std::min(
+      preferred_width,
+      chromeos::assistant::features::GetProactiveSuggestionsMaxWidth());
   return gfx::Size(preferred_width, GetHeightForWidth(preferred_width));
 }
 
diff --git a/chromeos/services/assistant/public/features.cc b/chromeos/services/assistant/public/features.cc
index 528c2c5..feb43c5 100644
--- a/chromeos/services/assistant/public/features.cc
+++ b/chromeos/services/assistant/public/features.cc
@@ -25,6 +25,10 @@
 const base::Feature kAssistantProactiveSuggestions{
     "AssistantProactiveSuggestions", base::FEATURE_DISABLED_BY_DEFAULT};
 
+// The maximum width (in dip) for the proactive suggestions chip.
+const base::FeatureParam<int> kAssistantProactiveSuggestionsMaxWidth{
+    &kAssistantProactiveSuggestions, "max-width", 280};
+
 const base::FeatureParam<std::string>
     kAssistantProactiveSuggestionsServerExperimentIds{
         &kAssistantProactiveSuggestions, "server-experiment-ids", ""};
@@ -77,6 +81,10 @@
     "AssistantEnableMediaSessionIntegration",
     base::FEATURE_DISABLED_BY_DEFAULT};
 
+int GetProactiveSuggestionsMaxWidth() {
+  return kAssistantProactiveSuggestionsMaxWidth.Get();
+}
+
 std::string GetProactiveSuggestionsServerExperimentIds() {
   return kAssistantProactiveSuggestionsServerExperimentIds.Get();
 }
diff --git a/chromeos/services/assistant/public/features.h b/chromeos/services/assistant/public/features.h
index 8e04c36..60cc77f 100644
--- a/chromeos/services/assistant/public/features.h
+++ b/chromeos/services/assistant/public/features.h
@@ -102,6 +102,9 @@
 extern const base::Feature kTimerTicks;
 
 COMPONENT_EXPORT(ASSISTANT_SERVICE_PUBLIC)
+int GetProactiveSuggestionsMaxWidth();
+
+COMPONENT_EXPORT(ASSISTANT_SERVICE_PUBLIC)
 std::string GetProactiveSuggestionsServerExperimentIds();
 
 COMPONENT_EXPORT(ASSISTANT_SERVICE_PUBLIC)