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

Unified Diff: chromecast/graphics/cast_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 | « chromecast/graphics/cast_screen.h ('k') | chromeos/dbus/fake_auth_policy_client.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chromecast/graphics/cast_screen.cc
diff --git a/chromecast/graphics/cast_screen.cc b/chromecast/graphics/cast_screen.cc
index a31ebb208dca8ba4a2fe7b2da95cd25018121223..deca8ec0472c79afe293bd283152e276cbe34796 100644
--- a/chromecast/graphics/cast_screen.cc
+++ b/chromecast/graphics/cast_screen.cc
@@ -9,7 +9,6 @@
#include "base/command_line.h"
#include "chromecast/public/graphics_properties_shlib.h"
#include "ui/aura/env.h"
-#include "ui/display/screen.h"
#include "ui/gfx/geometry/rect_conversions.h"
#include "ui/gfx/geometry/size.h"
#include "ui/gfx/geometry/size_conversions.h"
@@ -51,42 +50,18 @@ gfx::NativeWindow CastScreen::GetWindowAtScreenPoint(const gfx::Point& point) {
return gfx::NativeWindow(nullptr);
}
-int CastScreen::GetNumDisplays() const {
- return 1;
-}
-
-std::vector<display::Display> CastScreen::GetAllDisplays() const {
- return std::vector<display::Display>(1, display_);
-}
-
display::Display CastScreen::GetDisplayNearestWindow(
gfx::NativeWindow window) const {
- return display_;
-}
-
-display::Display CastScreen::GetDisplayNearestPoint(
- const gfx::Point& point) const {
- return display_;
+ return GetPrimaryDisplay();
}
-display::Display CastScreen::GetDisplayMatching(
- const gfx::Rect& match_rect) const {
- return display_;
-}
-
-display::Display CastScreen::GetPrimaryDisplay() const {
- return display_;
-}
-
-void CastScreen::AddObserver(display::DisplayObserver* observer) {}
-
-void CastScreen::RemoveObserver(display::DisplayObserver* observer) {}
-
-CastScreen::CastScreen() : display_(kDisplayId) {
+CastScreen::CastScreen() {
// Device scale factor computed relative to 720p display
+ display::Display display(kDisplayId);
const gfx::Size size = GetScreenResolution();
const float device_scale_factor = size.height() / 720.0f;
- display_.SetScaleAndBounds(device_scale_factor, gfx::Rect(size));
+ display.SetScaleAndBounds(device_scale_factor, gfx::Rect(size));
+ ProcessDisplayChanged(display, true /* is_primary */);
}
} // namespace chromecast
« no previous file with comments | « chromecast/graphics/cast_screen.h ('k') | chromeos/dbus/fake_auth_policy_client.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698