Index: extensions/shell/browser/shell_screen.cc |
diff --git a/extensions/shell/browser/shell_screen.cc b/extensions/shell/browser/shell_screen.cc |
index 157750871cc0da29202df01f27b197327e5555dc..00503cf3b597db1f5700aeadc269ca7e5113bb76 100644 |
--- a/extensions/shell/browser/shell_screen.cc |
+++ b/extensions/shell/browser/shell_screen.cc |
@@ -22,12 +22,13 @@ const int64_t kDisplayId = 0; |
} // namespace |
-ShellScreen::ShellScreen(const gfx::Size& size) |
- : host_(nullptr), display_(kDisplayId) { |
+ShellScreen::ShellScreen(const gfx::Size& size) : host_(nullptr) { |
DCHECK(!size.IsEmpty()); |
// Screen is positioned at (0,0). |
+ display::Display display(kDisplayId); |
gfx::Rect bounds(size); |
- display_.SetScaleAndBounds(1.0f, bounds); |
+ display.SetScaleAndBounds(1.0f, bounds); |
+ ProcessDisplayChanged(display, true /* is_primary */); |
} |
ShellScreen::~ShellScreen() { |
@@ -36,7 +37,8 @@ ShellScreen::~ShellScreen() { |
aura::WindowTreeHost* ShellScreen::CreateHostForPrimaryDisplay() { |
DCHECK(!host_); |
- host_ = aura::WindowTreeHost::Create(gfx::Rect(display_.GetSizeInPixel())); |
+ host_ = aura::WindowTreeHost::Create( |
+ gfx::Rect(GetPrimaryDisplay().GetSizeInPixel())); |
host_->window()->AddObserver(this); |
host_->InitHost(); |
return host_; |
@@ -48,7 +50,9 @@ void ShellScreen::OnWindowBoundsChanged(aura::Window* window, |
const gfx::Rect& old_bounds, |
const gfx::Rect& new_bounds) { |
DCHECK_EQ(host_->window(), window); |
- display_.SetSize(new_bounds.size()); |
+ display::Display display(GetPrimaryDisplay()); |
+ display.SetSize(new_bounds.size()); |
+ display_list().UpdateDisplay(display); |
} |
void ShellScreen::OnWindowDestroying(aura::Window* window) { |
@@ -71,35 +75,9 @@ gfx::NativeWindow ShellScreen::GetWindowAtScreenPoint(const gfx::Point& point) { |
return host_->window()->GetTopWindowContainingPoint(point); |
} |
-int ShellScreen::GetNumDisplays() const { |
- return 1; |
-} |
- |
-std::vector<display::Display> ShellScreen::GetAllDisplays() const { |
- return std::vector<display::Display>(1, display_); |
-} |
- |
display::Display ShellScreen::GetDisplayNearestWindow( |
gfx::NativeWindow window) const { |
- return display_; |
-} |
- |
-display::Display ShellScreen::GetDisplayNearestPoint( |
- const gfx::Point& point) const { |
- return display_; |
+ return GetPrimaryDisplay(); |
} |
-display::Display ShellScreen::GetDisplayMatching( |
- const gfx::Rect& match_rect) const { |
- return display_; |
-} |
- |
-display::Display ShellScreen::GetPrimaryDisplay() const { |
- return display_; |
-} |
- |
-void ShellScreen::AddObserver(display::DisplayObserver* observer) {} |
- |
-void ShellScreen::RemoveObserver(display::DisplayObserver* observer) {} |
- |
} // namespace extensions |