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

Unified Diff: chrome/browser/ui/ash/app_list/app_list_service_ash.cc

Issue 2739553005: Moves maintaining root_window_for_new_windows_ to Shell (Closed)
Patch Set: remove ash:: Created 3 years, 9 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: chrome/browser/ui/ash/app_list/app_list_service_ash.cc
diff --git a/chrome/browser/ui/ash/app_list/app_list_service_ash.cc b/chrome/browser/ui/ash/app_list/app_list_service_ash.cc
index 8b1207e54e33310942089ee61a32afa8880a625f..e690aa6e564d18eb41adcae551bcb70f9c9874f2 100644
--- a/chrome/browser/ui/ash/app_list/app_list_service_ash.cc
+++ b/chrome/browser/ui/ash/app_list/app_list_service_ash.cc
@@ -27,6 +27,8 @@
#include "ui/app_list/views/app_list_main_view.h"
#include "ui/app_list/views/app_list_view.h"
#include "ui/app_list/views/contents_view.h"
+#include "ui/display/display.h"
+#include "ui/display/screen.h"
namespace {
@@ -70,6 +72,12 @@ class AppListPresenterDelegateFactoryMus
DISALLOW_COPY_AND_ASSIGN(AppListPresenterDelegateFactoryMus);
};
+int64_t GetDisplayIdToShowAppListOn() {
+ return display::Screen::GetScreen()
+ ->GetDisplayNearestWindow(ash::Shell::GetRootWindowForNewWindows())
+ .id();
+}
+
} // namespace
// static
@@ -124,7 +132,7 @@ void AppListServiceAsh::ShowAndSwitchToState(
// TODO(calamity): This may cause the app list to show briefly before the
// state change. If this becomes an issue, add the ability to ash::Shell to
// load the app list without showing it.
- app_list_presenter_->Show(ash::Shell::GetTargetDisplayId());
+ app_list_presenter_->Show(GetDisplayIdToShowAppListOn());
app_list_was_open = false;
app_list_view = app_list_presenter_->GetView();
DCHECK(app_list_view);
@@ -146,7 +154,7 @@ base::FilePath AppListServiceAsh::GetProfilePath(
void AppListServiceAsh::ShowForProfile(Profile* /*default_profile*/) {
// This may not work correctly if the profile passed in is different from the
// one the ash Shell is currently using.
- app_list_presenter_->Show(ash::Shell::GetTargetDisplayId());
+ app_list_presenter_->Show(GetDisplayIdToShowAppListOn());
}
void AppListServiceAsh::ShowForAppInstall(Profile* profile,
« no previous file with comments | « chrome/browser/chromeos/ui/kiosk_external_update_notification.cc ('k') | chrome/browser/ui/ash/chrome_keyboard_ui.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698