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

Unified Diff: extensions/shell/browser/shell_screen.cc

Issue 2480203002: ui: Cleanup class/struct forward declarations (Closed)
Patch Set: Sync CL to position 430550 Created 4 years, 1 month 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 | « extensions/shell/browser/shell_screen.h ('k') | extensions/test/data/sockets_tcp/api/background.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
« no previous file with comments | « extensions/shell/browser/shell_screen.h ('k') | extensions/test/data/sockets_tcp/api/background.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698