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

Unified Diff: ash/display/display_manager.cc

Issue 1608733002: Remove ui/gfx/screen_type_delegate.h (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@metro-mode-4
Patch Set: and another rebase Created 4 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 | « no previous file | ash/display/display_manager_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/display/display_manager.cc
diff --git a/ash/display/display_manager.cc b/ash/display/display_manager.cc
index 2ec5afb40592cf9755d72788a760c8f7605c1583..f46fff718a17a9a0bae1a6af70b0290d6283ea23 100644
--- a/ash/display/display_manager.cc
+++ b/ash/display/display_manager.cc
@@ -145,15 +145,11 @@ DisplayManager::DisplayManager()
unified_desktop_enabled_ = base::CommandLine::ForCurrentProcess()->HasSwitch(
switches::kAshEnableUnifiedDesktop);
#endif
- gfx::Screen::SetScreenInstance(gfx::SCREEN_TYPE_ALTERNATE, screen_.get());
- gfx::Screen* current_native =
- gfx::Screen::GetScreenByType(gfx::SCREEN_TYPE_NATIVE);
+ gfx::Screen* current = gfx::Screen::GetScreen();
// If there is no native, or the native was for shutdown,
// use ash's screen.
- if (!current_native ||
- current_native == screen_for_shutdown) {
- gfx::Screen::SetScreenInstance(gfx::SCREEN_TYPE_NATIVE, screen_.get());
- }
+ if (!current || current == screen_for_shutdown)
+ gfx::Screen::SetScreenInstance(screen_.get());
}
DisplayManager::~DisplayManager() {
@@ -1068,16 +1064,9 @@ scoped_ptr<MouseWarpController> DisplayManager::CreateMouseWarpController(
}
void DisplayManager::CreateScreenForShutdown() const {
- bool native_is_ash =
- gfx::Screen::GetScreenByType(gfx::SCREEN_TYPE_NATIVE) == screen_.get();
delete screen_for_shutdown;
screen_for_shutdown = screen_->CloneForShutdown();
- gfx::Screen::SetScreenInstance(gfx::SCREEN_TYPE_ALTERNATE,
- screen_for_shutdown);
- if (native_is_ash) {
- gfx::Screen::SetScreenInstance(gfx::SCREEN_TYPE_NATIVE,
- screen_for_shutdown);
- }
+ gfx::Screen::SetScreenInstance(screen_for_shutdown);
}
void DisplayManager::UpdateInternalDisplayModeListForTest() {
« no previous file with comments | « no previous file | ash/display/display_manager_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698