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

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

Issue 2647833003: Adds AppListDelegate to AppList that is notified on visibility changes (Closed)
Patch Set: move 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
« no previous file with comments | « ui/app_list/presenter/app_list_presenter_impl.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 852a16bfa43d7a5717759015a2c164fa7658144f..0c48913317c96ef0f496c7d57595827e49a13309 100644
--- a/ui/app_list/presenter/app_list_presenter_impl.cc
+++ b/ui/app_list/presenter/app_list_presenter_impl.cc
@@ -13,6 +13,7 @@
#include "ui/aura/window.h"
#include "ui/compositor/layer.h"
#include "ui/compositor/scoped_layer_animation_settings.h"
+#include "ui/display/screen.h"
#include "ui/views/widget/widget.h"
namespace app_list {
@@ -120,7 +121,7 @@ void AppListPresenterImpl::SetAppList(mojom::AppListPtr 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());
+ app_list_->OnVisibilityChanged(IsVisible(), GetDisplayId());
}
////////////////////////////////////////////////////////////////////////////////
@@ -185,6 +186,15 @@ void AppListPresenterImpl::ScheduleAnimation() {
widget->SetBounds(target_bounds);
}
+int64_t AppListPresenterImpl::GetDisplayId() {
+ views::Widget* widget = view_ ? view_->GetWidget() : nullptr;
+ if (!widget)
+ return display::kInvalidDisplayId;
+ return display::Screen::GetScreen()
+ ->GetDisplayNearestWindow(widget->GetNativeView())
+ .id();
+}
+
////////////////////////////////////////////////////////////////////////////////
// AppListPresenterImpl, aura::client::FocusChangeObserver implementation:
@@ -234,7 +244,7 @@ void AppListPresenterImpl::OnWidgetVisibilityChanged(views::Widget* widget,
bool visible) {
DCHECK_EQ(view_->GetWidget(), widget);
if (app_list_)
- app_list_->OnVisibilityChanged(visible);
+ app_list_->OnVisibilityChanged(visible, GetDisplayId());
}
////////////////////////////////////////////////////////////////////////////////
« no previous file with comments | « ui/app_list/presenter/app_list_presenter_impl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698