Commit 22ed9900 authored by David Black's avatar David Black Committed by Commit Bot

Remove Assistant caption bar and launcher embedded Web UI.

Follow up CLs will merge AssistantWebView into
AssistantWebContainerView. This will simplify things as well as free up
the name AssistantWebView for AssistantWebView2 to use.

Bug: b:148080975
Change-Id: If8dcc64142b132417257d56db3f45d5c9f707bec
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2032567
Commit-Queue: David Black <dmblack@google.com>
Reviewed-by: default avatarTao Wu <wutao@chromium.org>
Reviewed-by: default avatarXiaohui Chen <xiaohuic@chromium.org>
Cr-Commit-Position: refs/heads/master@{#737575}
parent 5e9895c6
...@@ -16,14 +16,12 @@ ...@@ -16,14 +16,12 @@
#include "ash/assistant/model/assistant_ui_model.h" #include "ash/assistant/model/assistant_ui_model.h"
#include "ash/assistant/ui/assistant_ui_constants.h" #include "ash/assistant/ui/assistant_ui_constants.h"
#include "ash/assistant/ui/assistant_view_delegate.h" #include "ash/assistant/ui/assistant_view_delegate.h"
#include "ash/assistant/ui/assistant_web_view.h"
#include "ash/assistant/util/assistant_util.h" #include "ash/assistant/util/assistant_util.h"
#include "ash/public/cpp/app_list/app_list_config.h" #include "ash/public/cpp/app_list/app_list_config.h"
#include "ash/public/cpp/assistant/assistant_state.h" #include "ash/public/cpp/assistant/assistant_state.h"
#include "ash/public/cpp/view_shadow.h" #include "ash/public/cpp/view_shadow.h"
#include "ash/strings/grit/ash_strings.h" #include "ash/strings/grit/ash_strings.h"
#include "base/strings/utf_string_conversions.h" #include "base/strings/utf_string_conversions.h"
#include "chromeos/services/assistant/public/features.h"
#include "ui/base/l10n/l10n_util.h" #include "ui/base/l10n/l10n_util.h"
#include "ui/chromeos/search_box/search_box_constants.h" #include "ui/chromeos/search_box/search_box_constants.h"
#include "ui/views/background.h" #include "ui/views/background.h"
...@@ -71,25 +69,20 @@ AssistantPageView::~AssistantPageView() { ...@@ -71,25 +69,20 @@ AssistantPageView::~AssistantPageView() {
void AssistantPageView::InitLayout() { void AssistantPageView::InitLayout() {
SetPaintToLayer(); SetPaintToLayer();
layer()->SetFillsBoundsOpaquely(false); layer()->SetFillsBoundsOpaquely(false);
view_shadow_ = std::make_unique<ViewShadow>(this, kShadowElevation); view_shadow_ = std::make_unique<ViewShadow>(this, kShadowElevation);
view_shadow_->SetRoundedCornerRadius( view_shadow_->SetRoundedCornerRadius(
search_box::kSearchBoxBorderCornerRadiusSearchResult); search_box::kSearchBoxBorderCornerRadiusSearchResult);
SetBackground(views::CreateSolidBackground(SK_ColorWHITE)); SetBackground(views::CreateSolidBackground(SK_ColorWHITE));
SetLayoutManager(std::make_unique<views::FillLayout>()); SetLayoutManager(std::make_unique<views::FillLayout>());
if (assistant_view_delegate_) { // |assistant_view_delegate_| could be nullptr in test.
assistant_main_view_ = AddChildView( if (!assistant_view_delegate_)
std::make_unique<AssistantMainView>(assistant_view_delegate_)); return;
// Do not add web view when Assistant web container is enabled. assistant_main_view_ = AddChildView(
if (!chromeos::assistant::features::IsAssistantWebContainerEnabled()) { std::make_unique<AssistantMainView>(assistant_view_delegate_));
assistant_web_view_ = AddChildView(std::make_unique<AssistantWebView>(
assistant_view_delegate_,
/*web_container_view_delegate=*/nullptr));
}
}
} }
const char* AssistantPageView::GetClassName() const { const char* AssistantPageView::GetClassName() const {
...@@ -129,17 +122,10 @@ void AssistantPageView::RequestFocus() { ...@@ -129,17 +122,10 @@ void AssistantPageView::RequestFocus() {
if (assistant_main_view_) if (assistant_main_view_)
assistant_main_view_->RequestFocus(); assistant_main_view_->RequestFocus();
break; break;
case AssistantUiMode::kWebUi:
if (!chromeos::assistant::features::IsAssistantWebContainerEnabled()) {
if (assistant_web_view_)
assistant_web_view_->RequestFocus();
break;
}
NOTREACHED();
break;
case AssistantUiMode::kAmbientUi: case AssistantUiMode::kAmbientUi:
case AssistantUiMode::kMainUi: case AssistantUiMode::kMainUi:
case AssistantUiMode::kMiniUi: case AssistantUiMode::kMiniUi:
case AssistantUiMode::kWebUi:
NOTREACHED(); NOTREACHED();
break; break;
} }
...@@ -238,35 +224,6 @@ views::View* AssistantPageView::GetLastFocusableView() { ...@@ -238,35 +224,6 @@ views::View* AssistantPageView::GetLastFocusableView() {
this, GetWidget(), /*reverse=*/true, /*dont_loop=*/false); this, GetWidget(), /*reverse=*/true, /*dont_loop=*/false);
} }
void AssistantPageView::OnUiModeChanged(AssistantUiMode ui_mode,
bool due_to_interaction) {
for (auto* child : children())
child->SetVisible(false);
switch (ui_mode) {
case AssistantUiMode::kLauncherEmbeddedUi:
if (assistant_main_view_)
assistant_main_view_->SetVisible(true);
break;
case AssistantUiMode::kWebUi:
if (!chromeos::assistant::features::IsAssistantWebContainerEnabled()) {
if (assistant_web_view_)
assistant_web_view_->SetVisible(true);
break;
}
NOTREACHED();
break;
case AssistantUiMode::kAmbientUi:
case AssistantUiMode::kMainUi:
case AssistantUiMode::kMiniUi:
NOTREACHED();
break;
}
PreferredSizeChanged();
RequestFocus();
}
void AssistantPageView::OnUiVisibilityChanged( void AssistantPageView::OnUiVisibilityChanged(
AssistantVisibility new_visibility, AssistantVisibility new_visibility,
AssistantVisibility old_visibility, AssistantVisibility old_visibility,
...@@ -280,10 +237,6 @@ void AssistantPageView::OnUiVisibilityChanged( ...@@ -280,10 +237,6 @@ void AssistantPageView::OnUiVisibilityChanged(
return; return;
} }
// Update the visibility of the child views based on the current UI mode.
OnUiModeChanged(assistant_view_delegate_->GetUiModel()->ui_mode(),
/*due_to_interaction=*/false);
const bool prefer_voice = const bool prefer_voice =
assistant_view_delegate_->IsTabletMode() || assistant_view_delegate_->IsTabletMode() ||
AssistantState::Get()->launch_with_mic_open().value_or(false); AssistantState::Get()->launch_with_mic_open().value_or(false);
...@@ -300,17 +253,10 @@ int AssistantPageView::GetChildViewHeightForWidth(int width) const { ...@@ -300,17 +253,10 @@ int AssistantPageView::GetChildViewHeightForWidth(int width) const {
if (assistant_main_view_) if (assistant_main_view_)
height = assistant_main_view_->GetHeightForWidth(width); height = assistant_main_view_->GetHeightForWidth(width);
break; break;
case AssistantUiMode::kWebUi:
if (!chromeos::assistant::features::IsAssistantWebContainerEnabled()) {
if (assistant_web_view_)
height = assistant_web_view_->GetHeightForWidth(width);
break;
}
NOTREACHED();
break;
case AssistantUiMode::kAmbientUi: case AssistantUiMode::kAmbientUi:
case AssistantUiMode::kMainUi: case AssistantUiMode::kMainUi:
case AssistantUiMode::kMiniUi: case AssistantUiMode::kMiniUi:
case AssistantUiMode::kWebUi:
NOTREACHED(); NOTREACHED();
break; break;
} }
......
...@@ -16,7 +16,6 @@ namespace ash { ...@@ -16,7 +16,6 @@ namespace ash {
class AssistantMainView; class AssistantMainView;
class AssistantViewDelegate; class AssistantViewDelegate;
class AssistantWebView;
class ContentsView; class ContentsView;
class ViewShadow; class ViewShadow;
...@@ -59,8 +58,6 @@ class APP_LIST_EXPORT AssistantPageView : public AppListPage, ...@@ -59,8 +58,6 @@ class APP_LIST_EXPORT AssistantPageView : public AppListPage,
views::View* GetLastFocusableView() override; views::View* GetLastFocusableView() override;
// AssistantUiModelObserver: // AssistantUiModelObserver:
void OnUiModeChanged(AssistantUiMode ui_mode,
bool due_to_interaction) override;
void OnUiVisibilityChanged( void OnUiVisibilityChanged(
AssistantVisibility new_visibility, AssistantVisibility new_visibility,
AssistantVisibility old_visibility, AssistantVisibility old_visibility,
...@@ -73,11 +70,10 @@ class APP_LIST_EXPORT AssistantPageView : public AppListPage, ...@@ -73,11 +70,10 @@ class APP_LIST_EXPORT AssistantPageView : public AppListPage,
gfx::Rect AddShadowBorderToBounds(const gfx::Rect& bounds) const; gfx::Rect AddShadowBorderToBounds(const gfx::Rect& bounds) const;
AssistantViewDelegate* const assistant_view_delegate_; AssistantViewDelegate* const assistant_view_delegate_;
ContentsView* contents_view_; ContentsView* const contents_view_;
// Owned by the views hierarchy. // Owned by the view hierarchy.
AssistantMainView* assistant_main_view_ = nullptr; AssistantMainView* assistant_main_view_ = nullptr;
AssistantWebView* assistant_web_view_ = nullptr;
int min_height_dip_; int min_height_dip_;
......
...@@ -14,6 +14,7 @@ ...@@ -14,6 +14,7 @@
#include "ash/public/mojom/assistant_controller.mojom.h" #include "ash/public/mojom/assistant_controller.mojom.h"
#include "ash/strings/grit/ash_strings.h" #include "ash/strings/grit/ash_strings.h"
#include "base/i18n/message_formatter.h" #include "base/i18n/message_formatter.h"
#include "base/strings/stringprintf.h"
#include "base/strings/utf_string_conversions.h" #include "base/strings/utf_string_conversions.h"
#include "chromeos/services/assistant/public/features.h" #include "chromeos/services/assistant/public/features.h"
#include "chromeos/services/assistant/public/mojom/assistant.mojom.h" #include "chromeos/services/assistant/public/mojom/assistant.mojom.h"
......
...@@ -8,7 +8,6 @@ ...@@ -8,7 +8,6 @@
#include <utility> #include <utility>
#include "ash/accessibility/accessibility_controller_impl.h" #include "ash/accessibility/accessibility_controller_impl.h"
#include "ash/assistant/assistant_web_ui_controller.h"
#include "ash/assistant/util/deep_link_util.h" #include "ash/assistant/util/deep_link_util.h"
#include "ash/public/cpp/android_intent_helper.h" #include "ash/public/cpp/android_intent_helper.h"
#include "ash/public/cpp/ash_pref_names.h" #include "ash/public/cpp/ash_pref_names.h"
...@@ -27,11 +26,6 @@ ...@@ -27,11 +26,6 @@
namespace ash { namespace ash {
AssistantController::AssistantController() { AssistantController::AssistantController() {
if (chromeos::assistant::features::IsAssistantWebContainerEnabled()) {
assistant_web_ui_controller_ =
std::make_unique<AssistantWebUiController>(this);
}
assistant_state_controller_.AddObserver(this); assistant_state_controller_.AddObserver(this);
chromeos::CrasAudioHandler::Get()->AddAudioObserver(this); chromeos::CrasAudioHandler::Get()->AddAudioObserver(this);
AddObserver(this); AddObserver(this);
......
...@@ -22,6 +22,7 @@ ...@@ -22,6 +22,7 @@
#include "ash/assistant/assistant_suggestions_controller.h" #include "ash/assistant/assistant_suggestions_controller.h"
#include "ash/assistant/assistant_ui_controller.h" #include "ash/assistant/assistant_ui_controller.h"
#include "ash/assistant/assistant_view_delegate_impl.h" #include "ash/assistant/assistant_view_delegate_impl.h"
#include "ash/assistant/assistant_web_ui_controller.h"
#include "ash/assistant/ui/assistant_view_delegate.h" #include "ash/assistant/ui/assistant_view_delegate.h"
#include "ash/public/cpp/assistant/assistant_image_downloader.h" #include "ash/public/cpp/assistant/assistant_image_downloader.h"
#include "ash/public/cpp/assistant/assistant_interface_binder.h" #include "ash/public/cpp/assistant/assistant_interface_binder.h"
...@@ -151,7 +152,7 @@ class ASH_EXPORT AssistantController ...@@ -151,7 +152,7 @@ class ASH_EXPORT AssistantController
AssistantUiController* ui_controller() { return &assistant_ui_controller_; } AssistantUiController* ui_controller() { return &assistant_ui_controller_; }
AssistantWebUiController* web_ui_controller() { AssistantWebUiController* web_ui_controller() {
return assistant_web_ui_controller_.get(); return &assistant_web_ui_controller_;
} }
AssistantViewDelegate* view_delegate() { return &view_delegate_; } AssistantViewDelegate* view_delegate() { return &view_delegate_; }
...@@ -211,7 +212,7 @@ class ASH_EXPORT AssistantController ...@@ -211,7 +212,7 @@ class ASH_EXPORT AssistantController
AssistantSetupController assistant_setup_controller_{this}; AssistantSetupController assistant_setup_controller_{this};
AssistantSuggestionsController assistant_suggestions_controller_{this}; AssistantSuggestionsController assistant_suggestions_controller_{this};
AssistantUiController assistant_ui_controller_{this}; AssistantUiController assistant_ui_controller_{this};
std::unique_ptr<AssistantWebUiController> assistant_web_ui_controller_; AssistantWebUiController assistant_web_ui_controller_{this};
AssistantViewDelegateImpl view_delegate_{this}; AssistantViewDelegateImpl view_delegate_{this};
......
...@@ -105,24 +105,6 @@ void AssistantUiController::OnMicStateChanged(MicState mic_state) { ...@@ -105,24 +105,6 @@ void AssistantUiController::OnMicStateChanged(MicState mic_state) {
UpdateUiMode(); UpdateUiMode();
} }
bool AssistantUiController::OnCaptionButtonPressed(AssistantButtonId id) {
switch (id) {
case AssistantButtonId::kBack:
UpdateUiMode(AssistantUiMode::kLauncherEmbeddedUi);
return true;
case AssistantButtonId::kClose:
CloseUi(AssistantExitPoint::kCloseButton);
return true;
case AssistantButtonId::kMinimize:
UpdateUiMode(AssistantUiMode::kMiniUi);
return true;
default:
// No action necessary.
break;
}
return false;
}
void AssistantUiController::OnHighlighterEnabledChanged( void AssistantUiController::OnHighlighterEnabledChanged(
HighlighterEnabledState state) { HighlighterEnabledState state) {
if (state != HighlighterEnabledState::kEnabled) if (state != HighlighterEnabledState::kEnabled)
......
...@@ -14,7 +14,6 @@ ...@@ -14,7 +14,6 @@
#include "ash/assistant/model/assistant_interaction_model_observer.h" #include "ash/assistant/model/assistant_interaction_model_observer.h"
#include "ash/assistant/model/assistant_ui_model.h" #include "ash/assistant/model/assistant_ui_model.h"
#include "ash/assistant/model/assistant_ui_model_observer.h" #include "ash/assistant/model/assistant_ui_model_observer.h"
#include "ash/assistant/ui/caption_bar.h"
#include "ash/highlighter/highlighter_controller.h" #include "ash/highlighter/highlighter_controller.h"
#include "base/macros.h" #include "base/macros.h"
#include "base/optional.h" #include "base/optional.h"
...@@ -35,7 +34,6 @@ class ASH_EXPORT AssistantUiController ...@@ -35,7 +34,6 @@ class ASH_EXPORT AssistantUiController
: public AssistantControllerObserver, : public AssistantControllerObserver,
public AssistantInteractionModelObserver, public AssistantInteractionModelObserver,
public AssistantUiModelObserver, public AssistantUiModelObserver,
public CaptionBarDelegate,
public HighlighterController::Observer { public HighlighterController::Observer {
public: public:
explicit AssistantUiController(AssistantController* assistant_controller); explicit AssistantUiController(AssistantController* assistant_controller);
...@@ -56,9 +54,6 @@ class ASH_EXPORT AssistantUiController ...@@ -56,9 +54,6 @@ class ASH_EXPORT AssistantUiController
void OnInteractionStateChanged(InteractionState interaction_state) override; void OnInteractionStateChanged(InteractionState interaction_state) override;
void OnMicStateChanged(MicState mic_state) override; void OnMicStateChanged(MicState mic_state) override;
// CaptionBarDelegate:
bool OnCaptionButtonPressed(AssistantButtonId id) override;
// HighlighterController::Observer: // HighlighterController::Observer:
void OnHighlighterEnabledChanged(HighlighterEnabledState state) override; void OnHighlighterEnabledChanged(HighlighterEnabledState state) override;
......
...@@ -93,10 +93,6 @@ void AssistantViewDelegateImpl::RemoveUiModelObserver( ...@@ -93,10 +93,6 @@ void AssistantViewDelegateImpl::RemoveUiModelObserver(
assistant_controller_->ui_controller()->RemoveModelObserver(observer); assistant_controller_->ui_controller()->RemoveModelObserver(observer);
} }
CaptionBarDelegate* AssistantViewDelegateImpl::GetCaptionBarDelegate() {
return assistant_controller_->ui_controller();
}
void AssistantViewDelegateImpl::DownloadImage( void AssistantViewDelegateImpl::DownloadImage(
const GURL& url, const GURL& url,
AssistantImageDownloader::DownloadCallback callback) { AssistantImageDownloader::DownloadCallback callback) {
......
...@@ -40,7 +40,6 @@ class AssistantViewDelegateImpl : public AssistantViewDelegate { ...@@ -40,7 +40,6 @@ class AssistantViewDelegateImpl : public AssistantViewDelegate {
AssistantSuggestionsModelObserver* observer) override; AssistantSuggestionsModelObserver* observer) override;
void AddUiModelObserver(AssistantUiModelObserver* observer) override; void AddUiModelObserver(AssistantUiModelObserver* observer) override;
void RemoveUiModelObserver(AssistantUiModelObserver* observer) override; void RemoveUiModelObserver(AssistantUiModelObserver* observer) override;
CaptionBarDelegate* GetCaptionBarDelegate() override;
void DownloadImage( void DownloadImage(
const GURL& url, const GURL& url,
AssistantImageDownloader::DownloadCallback callback) override; AssistantImageDownloader::DownloadCallback callback) override;
......
...@@ -10,7 +10,6 @@ ...@@ -10,7 +10,6 @@
#include "ash/multi_user/multi_user_window_manager_impl.h" #include "ash/multi_user/multi_user_window_manager_impl.h"
#include "ash/session/session_controller_impl.h" #include "ash/session/session_controller_impl.h"
#include "ash/shell.h" #include "ash/shell.h"
#include "chromeos/services/assistant/public/features.h"
#include "ui/aura/client/aura_constants.h" #include "ui/aura/client/aura_constants.h"
#include "ui/events/event_observer.h" #include "ui/events/event_observer.h"
#include "ui/views/event_monitor.h" #include "ui/views/event_monitor.h"
...@@ -70,7 +69,6 @@ class AssistantWebContainerEventObserver : public ui::EventObserver { ...@@ -70,7 +69,6 @@ class AssistantWebContainerEventObserver : public ui::EventObserver {
AssistantWebUiController::AssistantWebUiController( AssistantWebUiController::AssistantWebUiController(
AssistantController* assistant_controller) AssistantController* assistant_controller)
: assistant_controller_(assistant_controller) { : assistant_controller_(assistant_controller) {
DCHECK(chromeos::assistant::features::IsAssistantWebContainerEnabled());
assistant_controller_->AddObserver(this); assistant_controller_->AddObserver(this);
} }
...@@ -121,7 +119,7 @@ void AssistantWebUiController::CloseUi() { ...@@ -121,7 +119,7 @@ void AssistantWebUiController::CloseUi() {
void AssistantWebUiController::OnBackButtonPressed() { void AssistantWebUiController::OnBackButtonPressed() {
DCHECK(web_container_view_); DCHECK(web_container_view_);
web_container_view_->OnBackButtonPressed(); web_container_view_->GoBack();
} }
AssistantWebContainerView* AssistantWebUiController::GetViewForTest() { AssistantWebContainerView* AssistantWebUiController::GetViewForTest() {
......
...@@ -35,9 +35,9 @@ enum class AssistantVisibility { ...@@ -35,9 +35,9 @@ enum class AssistantVisibility {
// Entries should not be renumbered and numeric values should never be reused. // Entries should not be renumbered and numeric values should never be reused.
// Only append to this enum is allowed if more buttons will be added. // Only append to this enum is allowed if more buttons will be added.
enum class AssistantButtonId { enum class AssistantButtonId {
kBack = 1, kBackDeprecated = 1,
kClose = 2, kCloseDeprecated = 2,
kMinimize = 3, kMinimizeDeprecated = 3,
kKeyboardInputToggle = 4, kKeyboardInputToggle = 4,
kVoiceInputToggle = 5, kVoiceInputToggle = 5,
kSettingsDeprecated = 6, kSettingsDeprecated = 6,
......
...@@ -46,8 +46,6 @@ component("ui") { ...@@ -46,8 +46,6 @@ component("ui") {
"base/assistant_scroll_view.h", "base/assistant_scroll_view.h",
"base/stack_layout.cc", "base/stack_layout.cc",
"base/stack_layout.h", "base/stack_layout.h",
"caption_bar.cc",
"caption_bar.h",
"dialog_plate/mic_view.cc", "dialog_plate/mic_view.cc",
"dialog_plate/mic_view.h", "dialog_plate/mic_view.h",
"logo_view/logo_view.cc", "logo_view/logo_view.cc",
......
...@@ -16,7 +16,6 @@ ...@@ -16,7 +16,6 @@
#include "ash/assistant/model/assistant_suggestions_model_observer.h" #include "ash/assistant/model/assistant_suggestions_model_observer.h"
#include "ash/assistant/model/assistant_ui_model.h" #include "ash/assistant/model/assistant_ui_model.h"
#include "ash/assistant/model/assistant_ui_model_observer.h" #include "ash/assistant/model/assistant_ui_model_observer.h"
#include "ash/assistant/ui/caption_bar.h"
#include "ash/public/cpp/assistant/assistant_image_downloader.h" #include "ash/public/cpp/assistant/assistant_image_downloader.h"
#include "ash/public/cpp/assistant/assistant_state.h" #include "ash/public/cpp/assistant/assistant_state.h"
#include "base/component_export.h" #include "base/component_export.h"
...@@ -109,9 +108,6 @@ class COMPONENT_EXPORT(ASSISTANT_UI) AssistantViewDelegate { ...@@ -109,9 +108,6 @@ class COMPONENT_EXPORT(ASSISTANT_UI) AssistantViewDelegate {
virtual void AddUiModelObserver(AssistantUiModelObserver* observer) = 0; virtual void AddUiModelObserver(AssistantUiModelObserver* observer) = 0;
virtual void RemoveUiModelObserver(AssistantUiModelObserver* observer) = 0; virtual void RemoveUiModelObserver(AssistantUiModelObserver* observer) = 0;
// Gets the caption bar delegate associated with the view delegate.
virtual CaptionBarDelegate* GetCaptionBarDelegate() = 0;
// Downloads the image found at the specified |url|. On completion, the // Downloads the image found at the specified |url|. On completion, the
// supplied |callback| will be run with the downloaded image. If the download // supplied |callback| will be run with the downloaded image. If the download
// attempt is unsuccessful, a NULL image is returned. // attempt is unsuccessful, a NULL image is returned.
......
...@@ -32,8 +32,6 @@ enum AssistantViewID { ...@@ -32,8 +32,6 @@ enum AssistantViewID {
kQueryView, kQueryView,
kSuggestionContainer, kSuggestionContainer,
kUiElementContainer, kUiElementContainer,
kWebView,
}; };
} // namespace ash } // namespace ash
......
...@@ -64,18 +64,14 @@ gfx::Size AssistantWebContainerView::CalculatePreferredSize() const { ...@@ -64,18 +64,14 @@ gfx::Size AssistantWebContainerView::CalculatePreferredSize() const {
return gfx::Size(width, height - non_client_frame_view_height); return gfx::Size(width, height - non_client_frame_view_height);
} }
void AssistantWebContainerView::OnBackButtonPressed() { bool AssistantWebContainerView::GoBack() {
assistant_web_view_->OnCaptionButtonPressed(AssistantButtonId::kBack); return assistant_web_view_->GoBack();
} }
void AssistantWebContainerView::OpenUrl(const GURL& url) { void AssistantWebContainerView::OpenUrl(const GURL& url) {
assistant_web_view_->OpenUrl(url); assistant_web_view_->OpenUrl(url);
} }
views::View* AssistantWebContainerView::GetCaptionBarForTesting() {
return assistant_web_view_->caption_bar_for_testing();
}
void AssistantWebContainerView::InitLayout() { void AssistantWebContainerView::InitLayout() {
views::Widget::InitParams params; views::Widget::InitParams params;
params.type = views::Widget::InitParams::TYPE_WINDOW; params.type = views::Widget::InitParams::TYPE_WINDOW;
......
...@@ -30,13 +30,14 @@ class COMPONENT_EXPORT(ASSISTANT_UI) AssistantWebContainerView ...@@ -30,13 +30,14 @@ class COMPONENT_EXPORT(ASSISTANT_UI) AssistantWebContainerView
const char* GetClassName() const override; const char* GetClassName() const override;
gfx::Size CalculatePreferredSize() const override; gfx::Size CalculatePreferredSize() const override;
void OnBackButtonPressed(); // Invoke to navigate back in the embedded WebContents' navigation stack. If
// backwards navigation is not possible, returns |false|. Otherwise |true| to
// indicate success.
bool GoBack();
// Invoke to open the specified |url|. // Invoke to open the specified |url|.
void OpenUrl(const GURL& url); void OpenUrl(const GURL& url);
views::View* GetCaptionBarForTesting();
private: private:
void InitLayout(); void InitLayout();
......
...@@ -88,16 +88,4 @@ TEST_F(AssistantWebContainerViewTest, CloseWindowByKeyEvent) { ...@@ -88,16 +88,4 @@ TEST_F(AssistantWebContainerViewTest, CloseWindowByKeyEvent) {
ASSERT_FALSE(view()); ASSERT_FALSE(view());
} }
TEST_F(AssistantWebContainerViewTest, NoCaptionBarInAssistantWebView) {
// Show Assistant Settings UI.
OpenAssistantSettings();
AssistantWebContainerView* container_view = view();
ASSERT_TRUE(container_view);
// AssistantWebContainerView's widget should have its own caption buttons in
// the ash frame view. Therefore the AssistantWebView should not have the
// caption bar.
ASSERT_FALSE(container_view->GetCaptionBarForTesting());
}
} // namespace ash } // namespace ash
...@@ -7,16 +7,12 @@ ...@@ -7,16 +7,12 @@
#include <algorithm> #include <algorithm>
#include <utility> #include <utility>
#include "ash/assistant/model/assistant_ui_model.h"
#include "ash/assistant/ui/assistant_ui_constants.h" #include "ash/assistant/ui/assistant_ui_constants.h"
#include "ash/assistant/ui/assistant_view_ids.h"
#include "ash/assistant/ui/assistant_web_view_delegate.h" #include "ash/assistant/ui/assistant_web_view_delegate.h"
#include "ash/assistant/util/deep_link_util.h" #include "ash/assistant/util/deep_link_util.h"
#include "ash/public/cpp/app_list/app_list_features.h"
#include "ash/public/cpp/assistant/assistant_web_view_factory.h" #include "ash/public/cpp/assistant/assistant_web_view_factory.h"
#include "base/bind.h" #include "base/bind.h"
#include "base/callback.h" #include "base/callback.h"
#include "chromeos/services/assistant/public/features.h"
#include "ui/aura/window.h" #include "ui/aura/window.h"
#include "ui/base/window_open_disposition.h" #include "ui/base/window_open_disposition.h"
#include "ui/compositor/layer.h" #include "ui/compositor/layer.h"
...@@ -35,19 +31,10 @@ AssistantWebView::AssistantWebView( ...@@ -35,19 +31,10 @@ AssistantWebView::AssistantWebView(
AssistantWebViewDelegate* web_container_view_delegate) AssistantWebViewDelegate* web_container_view_delegate)
: assistant_view_delegate_(assistant_view_delegate), : assistant_view_delegate_(assistant_view_delegate),
web_container_view_delegate_(web_container_view_delegate) { web_container_view_delegate_(web_container_view_delegate) {
SetID(AssistantViewID::kWebView);
InitLayout(); InitLayout();
// |AssistantWebView| has its own separate container when Assistant web
// container is enabled. The container will handle its own lifecycle.
if (!chromeos::assistant::features::IsAssistantWebContainerEnabled())
assistant_view_delegate_->AddUiModelObserver(this);
} }
AssistantWebView::~AssistantWebView() { AssistantWebView::~AssistantWebView() = default;
if (!chromeos::assistant::features::IsAssistantWebContainerEnabled())
assistant_view_delegate_->RemoveUiModelObserver(this);
}
const char* AssistantWebView::GetClassName() const { const char* AssistantWebView::GetClassName() const {
return "AssistantWebView"; return "AssistantWebView";
...@@ -58,19 +45,7 @@ gfx::Size AssistantWebView::CalculatePreferredSize() const { ...@@ -58,19 +45,7 @@ gfx::Size AssistantWebView::CalculatePreferredSize() const {
} }
int AssistantWebView::GetHeightForWidth(int width) const { int AssistantWebView::GetHeightForWidth(int width) const {
// The Assistant web container has fixed height. return INT_MAX;
if (chromeos::assistant::features::IsAssistantWebContainerEnabled())
return INT_MAX;
if (app_list_features::IsAssistantLauncherUIEnabled())
return kMaxHeightEmbeddedDip;
// |height| <= |kMaxHeightDip|.
// |height| should not exceed the height of the usable work area.
const gfx::Rect usable_work_area =
assistant_view_delegate_->GetUiModel()->usable_work_area();
return std::min(kMaxHeightDip, usable_work_area.height());
} }
void AssistantWebView::ChildPreferredSizeChanged(views::View* child) { void AssistantWebView::ChildPreferredSizeChanged(views::View* child) {
...@@ -84,53 +59,18 @@ void AssistantWebView::ChildPreferredSizeChanged(views::View* child) { ...@@ -84,53 +59,18 @@ void AssistantWebView::ChildPreferredSizeChanged(views::View* child) {
void AssistantWebView::InitLayout() { void AssistantWebView::InitLayout() {
SetLayoutManager(std::make_unique<views::BoxLayout>( SetLayoutManager(std::make_unique<views::BoxLayout>(
views::BoxLayout::Orientation::kVertical)); views::BoxLayout::Orientation::kVertical));
// Will use ash caption buttons when Assistant web container is enabled.
if (chromeos::assistant::features::IsAssistantWebContainerEnabled())
return;
// Caption bar.
caption_bar_ = new CaptionBar();
caption_bar_->set_delegate(this);
caption_bar_->SetButtonVisible(AssistantButtonId::kMinimize, false);
if (app_list_features::IsAssistantLauncherUIEnabled())
caption_bar_->SetButtonVisible(AssistantButtonId::kClose, false);
AddChildView(caption_bar_);
}
bool AssistantWebView::OnCaptionButtonPressed(AssistantButtonId id) {
// We need special handling of the back button. When possible, the back button
// should navigate backwards in the WebContents' history stack. If we can't go
// back, control is returned to the primary caption button delegate.
if (id == AssistantButtonId::kBack && contents_view_ &&
contents_view_->GoBack()) {
return true;
}
// For all other buttons we defer to our primary caption button delegate.
return assistant_view_delegate_->GetCaptionBarDelegate()
->OnCaptionButtonPressed(id);
} }
void AssistantWebView::DidStopLoading() { void AssistantWebView::DidStopLoading() {
// We should only respond to the |DidStopLoading| event the first time, to add // We should only respond to the |DidStopLoading| event the first time, to add
// the view for contents to our view hierarchy and perform other one-time view // the view for contents to our view hierarchy and perform other one-time view
// initializations. // initializations.
if (contents_view_initialized_) if (contents_view_->parent())
return; return;
contents_view_initialized_ = true; contents_view_->SetPreferredSize(GetPreferredSize());
UpdateContentSize();
AddChildView(contents_view_.get()); AddChildView(contents_view_.get());
SetFocusBehavior(FocusBehavior::ALWAYS); SetFocusBehavior(FocusBehavior::ALWAYS);
// We need to clip the corners of our WebContents to match our container.
if (!chromeos::assistant::features::IsAssistantWebContainerEnabled()) {
contents_view_->GetNativeView()->layer()->SetRoundedCornerRadius(
{/*top_left=*/0, /*top_right=*/0, /*bottom_right=*/kCornerRadiusDip,
/*bottom_left=*/kCornerRadiusDip});
}
} }
void AssistantWebView::DidSuppressNavigation(const GURL& url, void AssistantWebView::DidSuppressNavigation(const GURL& url,
...@@ -154,27 +94,13 @@ void AssistantWebView::DidSuppressNavigation(const GURL& url, ...@@ -154,27 +94,13 @@ void AssistantWebView::DidSuppressNavigation(const GURL& url,
} }
void AssistantWebView::DidChangeCanGoBack(bool can_go_back) { void AssistantWebView::DidChangeCanGoBack(bool can_go_back) {
if (!chromeos::assistant::features::IsAssistantWebContainerEnabled())
return;
DCHECK(web_container_view_delegate_); DCHECK(web_container_view_delegate_);
web_container_view_delegate_->UpdateBackButtonVisibility(GetWidget(), web_container_view_delegate_->UpdateBackButtonVisibility(GetWidget(),
can_go_back); can_go_back);
} }
void AssistantWebView::OnUiVisibilityChanged( bool AssistantWebView::GoBack() {
AssistantVisibility new_visibility, return contents_view_ && contents_view_->GoBack();
AssistantVisibility old_visibility,
base::Optional<AssistantEntryPoint> entry_point,
base::Optional<AssistantExitPoint> exit_point) {
// When Assistant web container is enabled, |assistant_web_view| has its own
// container and this method should not be called on it.
DCHECK(!chromeos::assistant::features::IsAssistantWebContainerEnabled());
// When the Assistant UI is closed we need to clear the |contents_| in order
// to free the memory.
if (new_visibility == AssistantVisibility::kClosed)
RemoveContents();
} }
void AssistantWebView::OpenUrl(const GURL& url) { void AssistantWebView::OpenUrl(const GURL& url) {
...@@ -198,13 +124,6 @@ void AssistantWebView::OpenUrl(const GURL& url) { ...@@ -198,13 +124,6 @@ void AssistantWebView::OpenUrl(const GURL& url) {
contents_view_->Navigate(url); contents_view_->Navigate(url);
} }
void AssistantWebView::OnUsableWorkAreaChanged(
const gfx::Rect& usable_work_area) {
DCHECK(!chromeos::assistant::features::IsAssistantWebContainerEnabled());
UpdateContentSize();
}
void AssistantWebView::RemoveContents() { void AssistantWebView::RemoveContents() {
if (!contents_view_) if (!contents_view_)
return; return;
...@@ -215,23 +134,6 @@ void AssistantWebView::RemoveContents() { ...@@ -215,23 +134,6 @@ void AssistantWebView::RemoveContents() {
contents_view_->RemoveObserver(this); contents_view_->RemoveObserver(this);
contents_view_.reset(); contents_view_.reset();
contents_view_initialized_ = false;
}
void AssistantWebView::UpdateContentSize() {
if (!contents_view_ || !contents_view_initialized_)
return;
if (chromeos::assistant::features::IsAssistantWebContainerEnabled()) {
contents_view_->SetPreferredSize(GetPreferredSize());
return;
}
const gfx::Size preferred_size = gfx::Size(
kPreferredWidthDip, GetHeightForWidth(kPreferredWidthDip) -
caption_bar_->GetPreferredSize().height());
contents_view_->SetPreferredSize(preferred_size);
} }
} // namespace ash } // namespace ash
...@@ -9,9 +9,7 @@ ...@@ -9,9 +9,7 @@
#include <memory> #include <memory>
#include <string> #include <string>
#include "ash/assistant/model/assistant_ui_model_observer.h"
#include "ash/assistant/ui/assistant_view_delegate.h" #include "ash/assistant/ui/assistant_view_delegate.h"
#include "ash/assistant/ui/caption_bar.h"
#include "ash/public/cpp/assistant/assistant_web_view_2.h" #include "ash/public/cpp/assistant/assistant_web_view_2.h"
#include "base/component_export.h" #include "base/component_export.h"
#include "base/macros.h" #include "base/macros.h"
...@@ -23,16 +21,10 @@ namespace ash { ...@@ -23,16 +21,10 @@ namespace ash {
enum class AssistantButtonId; enum class AssistantButtonId;
class AssistantWebViewDelegate; class AssistantWebViewDelegate;
// TODO(b/146520500): Merge into AssistantWebContainerView after deprecating // TODO(b/146520500): Merge into AssistantWebContainerView.
// standalone Assistant UI.
// AssistantWebView is a child of AssistantContainerView which allows Assistant
// UI to render remotely hosted content within its bubble. It provides a
// CaptionBar for window level controls and embeds WebContents.
class COMPONENT_EXPORT(ASSISTANT_UI) AssistantWebView class COMPONENT_EXPORT(ASSISTANT_UI) AssistantWebView
: public views::View, : public views::View,
public CaptionBarDelegate, public AssistantWebView2::Observer {
public AssistantWebView2::Observer,
public AssistantUiModelObserver {
public: public:
AssistantWebView(AssistantViewDelegate* assistant_view_delegate, AssistantWebView(AssistantViewDelegate* assistant_view_delegate,
AssistantWebViewDelegate* web_container_view_delegate); AssistantWebViewDelegate* web_container_view_delegate);
...@@ -44,9 +36,6 @@ class COMPONENT_EXPORT(ASSISTANT_UI) AssistantWebView ...@@ -44,9 +36,6 @@ class COMPONENT_EXPORT(ASSISTANT_UI) AssistantWebView
int GetHeightForWidth(int width) const override; int GetHeightForWidth(int width) const override;
void ChildPreferredSizeChanged(views::View* child) override; void ChildPreferredSizeChanged(views::View* child) override;
// CaptionBarDelegate:
bool OnCaptionButtonPressed(AssistantButtonId id) override;
// AssistantWebView2::Observer: // AssistantWebView2::Observer:
void DidStopLoading() override; void DidStopLoading() override;
void DidSuppressNavigation(const GURL& url, void DidSuppressNavigation(const GURL& url,
...@@ -54,38 +43,24 @@ class COMPONENT_EXPORT(ASSISTANT_UI) AssistantWebView ...@@ -54,38 +43,24 @@ class COMPONENT_EXPORT(ASSISTANT_UI) AssistantWebView
bool from_user_gesture) override; bool from_user_gesture) override;
void DidChangeCanGoBack(bool can_go_back) override; void DidChangeCanGoBack(bool can_go_back) override;
// AssistantUiModelObserver: // Invoke to navigate back in the embedded WebContents' navigation stack. If
void OnUiVisibilityChanged( // backwards navigation is not possible, returns |false|. Otherwise |true| to
AssistantVisibility new_visibility, // indicate success.
AssistantVisibility old_visibility, bool GoBack();
base::Optional<AssistantEntryPoint> entry_point,
base::Optional<AssistantExitPoint> exit_point) override;
void OnUsableWorkAreaChanged(const gfx::Rect& usable_work_area) override;
// Invoke to open the specified |url|. // Invoke to open the specified |url|.
void OpenUrl(const GURL& url); void OpenUrl(const GURL& url);
views::View* caption_bar_for_testing() { return caption_bar_; }
private: private:
void InitLayout(); void InitLayout();
void RemoveContents(); void RemoveContents();
// Updates the size of the web contents by changing its view size to avoid // TODO(b/143177141): Remove AssistantViewDelegate.
// either being cut or not fully filling the whole container when the usable
// work area changed.
void UpdateContentSize();
// TODO(b/143177141): Remove AssistantViewDelegate once standalone is
// deprecated.
AssistantViewDelegate* const assistant_view_delegate_; AssistantViewDelegate* const assistant_view_delegate_;
AssistantWebViewDelegate* const web_container_view_delegate_; AssistantWebViewDelegate* const web_container_view_delegate_;
CaptionBar* caption_bar_ = nullptr; // Owned by view hierarchy.
std::unique_ptr<AssistantWebView2> contents_view_; std::unique_ptr<AssistantWebView2> contents_view_;
bool contents_view_initialized_ = false;
DISALLOW_COPY_AND_ASSIGN(AssistantWebView); DISALLOW_COPY_AND_ASSIGN(AssistantWebView);
}; };
......
// Copyright 2018 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "ash/assistant/ui/caption_bar.h"
#include "ash/assistant/model/assistant_ui_model.h"
#include "ash/assistant/ui/assistant_ui_constants.h"
#include "ash/assistant/ui/base/assistant_button.h"
#include "ash/public/cpp/vector_icons/vector_icons.h"
#include "ash/resources/vector_icons/vector_icons.h"
#include "ui/gfx/color_palette.h"
#include "ui/gfx/paint_vector_icon.h"
#include "ui/strings/grit/ui_strings.h"
#include "ui/views/controls/button/image_button.h"
#include "ui/views/event_monitor.h"
#include "ui/views/layout/box_layout.h"
#include "ui/views/widget/widget.h"
#include "ui/views/window/vector_icons/vector_icons.h"
namespace ash {
namespace {
// Appearance.
constexpr int kCaptionButtonSizeDip = 32;
constexpr int kPreferredHeightDip = 48;
constexpr int kVectorIconSizeDip = 12;
// CaptionButton ---------------------------------------------------------------
std::unique_ptr<AssistantButton> CreateCaptionButton(
const gfx::VectorIcon& icon,
int accessible_name_id,
AssistantButtonId button_id,
AssistantButtonListener* listener) {
return AssistantButton::Create(listener, icon, kCaptionButtonSizeDip,
kVectorIconSizeDip, accessible_name_id,
button_id);
}
} // namespace
// CaptionBar ------------------------------------------------------------------
CaptionBar::CaptionBar() {
InitLayout();
}
CaptionBar::~CaptionBar() = default;
const char* CaptionBar::GetClassName() const {
return "CaptionBar";
}
gfx::Size CaptionBar::CalculatePreferredSize() const {
return gfx::Size(INT_MAX, GetHeightForWidth(INT_MAX));
}
int CaptionBar::GetHeightForWidth(int width) const {
return kPreferredHeightDip;
}
void CaptionBar::VisibilityChanged(views::View* starting_from, bool visible) {
if (!IsDrawn()) {
event_monitor_.reset();
return;
}
views::Widget* widget = GetWidget();
if (!widget)
return;
// Only when the CaptionBar is drawn do we allow it to monitor key press
// events. We monitor key press events to handle hotkeys that behave the same
// as caption bar buttons. Note that we use an EventMonitor rather than adding
// accelerators so that we always receive key events, even if an embedded
// navigable contents in our view hierarchy has focus.
gfx::NativeWindow root_window = widget->GetNativeWindow()->GetRootWindow();
event_monitor_ = views::EventMonitor::CreateWindowMonitor(
this, root_window, {ui::ET_KEY_PRESSED});
}
void CaptionBar::OnButtonPressed(AssistantButtonId button_id) {
HandleButton(button_id);
}
void CaptionBar::OnEvent(const ui::Event& event) {
const ui::KeyEvent& key_event = static_cast<const ui::KeyEvent&>(event);
switch (key_event.key_code()) {
case ui::VKEY_BROWSER_BACK:
HandleButton(AssistantButtonId::kBack);
break;
case ui::VKEY_ESCAPE:
HandleButton(AssistantButtonId::kClose);
break;
case ui::VKEY_W:
if (key_event.IsControlDown())
HandleButton(AssistantButtonId::kClose);
break;
default:
// No action necessary.
break;
}
}
void CaptionBar::SetButtonVisible(AssistantButtonId id, bool visible) {
views::View* button = GetButtonWithId(id);
if (button)
button->SetVisible(visible);
}
void CaptionBar::InitLayout() {
views::BoxLayout* layout_manager =
SetLayoutManager(std::make_unique<views::BoxLayout>(
views::BoxLayout::Orientation::kHorizontal,
gfx::Insets(0, kSpacingDip), kSpacingDip));
layout_manager->set_cross_axis_alignment(
views::BoxLayout::CrossAxisAlignment::kCenter);
// Back.
AddButton(CreateCaptionButton(kWindowControlBackIcon, IDS_APP_LIST_BACK,
AssistantButtonId::kBack, this));
// Spacer.
auto spacer = std::make_unique<views::View>();
layout_manager->SetFlexForView(AddChildView(std::move(spacer)), 1);
// Minimize.
AddButton(CreateCaptionButton(views::kWindowControlMinimizeIcon,
IDS_APP_ACCNAME_MINIMIZE,
AssistantButtonId::kMinimize, this));
// Close.
AddButton(CreateCaptionButton(views::kWindowControlCloseIcon,
IDS_APP_ACCNAME_CLOSE,
AssistantButtonId::kClose, this));
}
void CaptionBar::AddButton(std::unique_ptr<AssistantButton> button) {
buttons_.push_back(button.get());
AddChildView(std::move(button));
}
void CaptionBar::HandleButton(AssistantButtonId id) {
if (!GetButtonWithId(id)->GetVisible())
return;
// If the delegate returns |true| it has handled the event and wishes to
// prevent default behavior from being performed.
if (delegate_ && delegate_->OnCaptionButtonPressed(id))
return;
switch (id) {
case AssistantButtonId::kClose:
GetWidget()->Close();
break;
default:
// No default behavior defined.
NOTIMPLEMENTED();
break;
}
}
AssistantButton* CaptionBar::GetButtonWithId(AssistantButtonId id) {
for (auto* button : buttons_) {
if (button->GetAssistantButtonId() == id)
return button;
}
return nullptr;
}
} // namespace ash
// Copyright 2018 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef ASH_ASSISTANT_UI_CAPTION_BAR_H_
#define ASH_ASSISTANT_UI_CAPTION_BAR_H_
#include <memory>
#include "ash/assistant/ui/base/assistant_button_listener.h"
#include "base/component_export.h"
#include "base/macros.h"
#include "ui/events/event_observer.h"
#include "ui/views/controls/button/button.h"
#include "ui/views/view.h"
namespace views {
class EventMonitor;
} // namespace views
namespace ash {
class AssistantButton;
// CaptionBarDelegate ----------------------------------------------------------
// TODO(wutao): Remove this class and call methods on AssistantViewDelegate
// directly.
class COMPONENT_EXPORT(ASSISTANT_UI) CaptionBarDelegate {
public:
// Invoked when the caption button identified by |id| is pressed. Return
// |true| to prevent default behavior from being performed, false otherwise.
virtual bool OnCaptionButtonPressed(AssistantButtonId id) = 0;
protected:
virtual ~CaptionBarDelegate() = default;
};
// CaptionBar ------------------------------------------------------------------
class COMPONENT_EXPORT(ASSISTANT_UI) CaptionBar : public views::View,
public AssistantButtonListener
,
public ui::EventObserver {
public:
// This is necessary to inform clang that our overload of |OnEvent|,
// overridden from |ui::EventObserver|, is intentional.
using ui::EventHandler::OnEvent;
CaptionBar();
~CaptionBar() override;
// views::View:
const char* GetClassName() const override;
gfx::Size CalculatePreferredSize() const override;
int GetHeightForWidth(int width) const override;
void VisibilityChanged(views::View* starting_from, bool visible) override;
// AssistantButtonListener:
void OnButtonPressed(AssistantButtonId button_id) override;
// ui::EventObserver:
void OnEvent(const ui::Event& event) override;
void set_delegate(CaptionBarDelegate* delegate) { delegate_ = delegate; }
// Sets visibility for the caption button identified by |id|.
void SetButtonVisible(AssistantButtonId id, bool visible);
private:
void InitLayout();
void AddButton(std::unique_ptr<AssistantButton> button);
void HandleButton(AssistantButtonId id);
AssistantButton* GetButtonWithId(AssistantButtonId id);
CaptionBarDelegate* delegate_ = nullptr;
std::unique_ptr<views::EventMonitor> event_monitor_;
std::vector<AssistantButton*> buttons_;
DISALLOW_COPY_AND_ASSIGN(CaptionBar);
};
} // namespace ash
#endif // ASH_ASSISTANT_UI_CAPTION_BAR_H_
...@@ -190,10 +190,6 @@ bool IsVoiceMatchDisabled() { ...@@ -190,10 +190,6 @@ bool IsVoiceMatchDisabled() {
return base::FeatureList::IsEnabled(kDisableVoiceMatch); return base::FeatureList::IsEnabled(kDisableVoiceMatch);
} }
bool IsAssistantWebContainerEnabled() {
return app_list_features::IsAssistantLauncherUIEnabled();
}
} // namespace features } // namespace features
} // namespace assistant } // namespace assistant
} // namespace chromeos } // namespace chromeos
...@@ -139,9 +139,6 @@ COMPONENT_EXPORT(ASSISTANT_SERVICE_PUBLIC) bool IsWarmerWelcomeEnabled(); ...@@ -139,9 +139,6 @@ COMPONENT_EXPORT(ASSISTANT_SERVICE_PUBLIC) bool IsWarmerWelcomeEnabled();
COMPONENT_EXPORT(ASSISTANT_SERVICE_PUBLIC) bool IsVoiceMatchDisabled(); COMPONENT_EXPORT(ASSISTANT_SERVICE_PUBLIC) bool IsVoiceMatchDisabled();
COMPONENT_EXPORT(ASSISTANT_SERVICE_PUBLIC)
bool IsAssistantWebContainerEnabled();
} // namespace features } // namespace features
} // namespace assistant } // namespace assistant
} // namespace chromeos } // namespace chromeos
......
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