Assistant Cleanup: Refactor AssistantWebView
The AssistantWebView is used by Ash to work around dependency
restrictions.
This change rename the class to AshWebView, detach with the Assistant
to expose the class to other ash features.
Bug: b/198811694
Test: Run existing tests
Change-Id: I7dba283247f3d62ca979b49a38922ba94ffd78d0
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3247881
Reviewed-by: Meilin Wang <[email protected]>
Reviewed-by: Xiyuan Xia <[email protected]>
Commit-Queue: Yue Li <[email protected]>
Cr-Commit-Position: refs/heads/main@{#936098}
diff --git a/ash/assistant/model/ui/assistant_card_element.cc b/ash/assistant/model/ui/assistant_card_element.cc
index 6c46d4d..6a67d03 100644
--- a/ash/assistant/model/ui/assistant_card_element.cc
+++ b/ash/assistant/model/ui/assistant_card_element.cc
@@ -7,14 +7,14 @@
#include <utility>
#include "ash/assistant/ui/assistant_ui_constants.h"
-#include "ash/public/cpp/assistant/assistant_web_view_factory.h"
+#include "ash/public/cpp/ash_web_view_factory.h"
#include "base/base64.h"
namespace ash {
// AssistantCardElement::Processor ---------------------------------------------
-class AssistantCardElement::Processor : public AssistantWebView::Observer {
+class AssistantCardElement::Processor : public AshWebView::Observer {
public:
Processor(AssistantCardElement* card_element, ProcessingCallback callback)
: card_element_(card_element), callback_(std::move(callback)) {}
@@ -35,7 +35,7 @@
const int width_dip = kPreferredWidthDip - 2 * kHorizontalMarginDip;
// Configure parameters for the card.
- AssistantWebView::InitParams contents_params;
+ AshWebView::InitParams contents_params;
contents_params.enable_auto_resize = true;
contents_params.min_size = gfx::Size(width_dip, 1);
contents_params.max_size = gfx::Size(width_dip, INT_MAX);
@@ -43,7 +43,7 @@
// Create |contents_view_| and retain ownership until it is added to the
// view hierarchy. If that never happens, it will be still be cleaned up.
- contents_view_ = AssistantWebViewFactory::Get()->Create(contents_params);
+ contents_view_ = AshWebViewFactory::Get()->Create(contents_params);
// Observe |contents_view_| so that we are notified when loading is
// complete.
@@ -59,7 +59,7 @@
}
private:
- // AssistantWebView::Observer:
+ // AshWebView::Observer:
void DidStopLoading() override {
contents_view_->RemoveObserver(this);
@@ -73,7 +73,7 @@
AssistantCardElement* const card_element_;
ProcessingCallback callback_;
- std::unique_ptr<AssistantWebView> contents_view_;
+ std::unique_ptr<AshWebView> contents_view_;
};
// AssistantCardElement --------------------------------------------------------