Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(428)

Unified Diff: ui/app_list/presenter/app_list_presenter_impl.cc

Issue 2576913002: Use mojo app list interfaces for mash and classic ash. (Closed)
Patch Set: Sync and rebase Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: ui/app_list/presenter/app_list_presenter_impl.cc
diff --git a/ui/app_list/presenter/app_list_presenter_impl.cc b/ui/app_list/presenter/app_list_presenter_impl.cc
index e6db16a76d1a001b89936e5dee210b80e819e52d..852a16bfa43d7a5717759015a2c164fa7658144f 100644
--- a/ui/app_list/presenter/app_list_presenter_impl.cc
+++ b/ui/app_list/presenter/app_list_presenter_impl.cc
@@ -31,9 +31,9 @@ ui::Layer* GetLayer(views::Widget* widget) {
} // namespace
AppListPresenterImpl::AppListPresenterImpl(
- AppListPresenterDelegateFactory* factory)
- : factory_(factory) {
- DCHECK(factory);
+ std::unique_ptr<AppListPresenterDelegateFactory> factory)
+ : factory_(std::move(factory)) {
+ DCHECK(factory_);
}
AppListPresenterImpl::~AppListPresenterImpl() {
@@ -57,6 +57,9 @@ void AppListPresenterImpl::Show(int64_t display_id) {
return;
is_visible_ = true;
+ if (app_list_)
+ app_list_->OnTargetVisibilityChanged(GetTargetVisibility());
+
if (view_) {
ScheduleAnimation();
} else {
@@ -80,6 +83,8 @@ void AppListPresenterImpl::Dismiss() {
DCHECK(view_);
is_visible_ = false;
+ if (app_list_)
+ app_list_->OnTargetVisibilityChanged(GetTargetVisibility());
// The dismissal may have occurred in response to the app list losing
// activation. Otherwise, our widget is currently active. When the animation
@@ -110,6 +115,14 @@ bool AppListPresenterImpl::GetTargetVisibility() const {
return is_visible_;
}
+void AppListPresenterImpl::SetAppList(mojom::AppListPtr app_list) {
+ DCHECK(app_list);
+ app_list_ = std::move(app_list);
+ // Notify the app list interface of the current [target] visibility.
+ app_list_->OnTargetVisibilityChanged(GetTargetVisibility());
+ app_list_->OnVisibilityChanged(IsVisible());
+}
+
////////////////////////////////////////////////////////////////////////////////
// AppListPresenterImpl, private:
@@ -211,12 +224,19 @@ void AppListPresenterImpl::OnImplicitAnimationsCompleted() {
// AppListPresenterImpl, views::WidgetObserver implementation:
void AppListPresenterImpl::OnWidgetDestroying(views::Widget* widget) {
- DCHECK(view_->GetWidget() == widget);
+ DCHECK_EQ(view_->GetWidget(), widget);
if (is_visible_)
Dismiss();
ResetView();
}
+void AppListPresenterImpl::OnWidgetVisibilityChanged(views::Widget* widget,
+ bool visible) {
+ DCHECK_EQ(view_->GetWidget(), widget);
+ if (app_list_)
+ app_list_->OnVisibilityChanged(visible);
+}
+
////////////////////////////////////////////////////////////////////////////////
// AppListPresenterImpl, PaginationModelObserver implementation:
« no previous file with comments | « ui/app_list/presenter/app_list_presenter_impl.h ('k') | ui/app_list/presenter/app_list_presenter_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698