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

Unified Diff: services/ui/display/platform_screen_ozone.cc

Issue 2310133002: Add mojom::DisplayController. (Closed)
Patch Set: Address comments. Created 4 years, 3 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 | « services/ui/display/platform_screen_ozone.h ('k') | services/ui/display/platform_screen_ozone_unittests.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: services/ui/display/platform_screen_ozone.cc
diff --git a/services/ui/display/platform_screen_ozone.cc b/services/ui/display/platform_screen_ozone.cc
index 7b4b22e24d53d0bc7cbe5a470dbf2840b1d0cb21..3304f02eb87da5612bf06e742e24710d5cf2be7f 100644
--- a/services/ui/display/platform_screen_ozone.cc
+++ b/services/ui/display/platform_screen_ozone.cc
@@ -64,6 +64,40 @@ int64_t PlatformScreenOzone::GetPrimaryDisplayId() const {
return primary_display_id_;
}
+void PlatformScreenOzone::ToggleVirtualDisplay(
+ const ToggleVirtualDisplayCallback& callback) {
+ if (base::SysInfo::IsRunningOnChromeOS()) {
+ callback.Run(false);
+ return;
+ }
+
+ if (cached_displays_.size() == 1) {
+ display_configurator_.AddVirtualDisplay(cached_displays_[0].bounds.size());
+ callback.Run(true);
+ } else if (cached_displays_.size() > 1) {
+ callback.Run(
+ display_configurator_.RemoveVirtualDisplay(cached_displays_.back().id));
+ } else {
+ NOTREACHED();
+ callback.Run(false);
+ }
+}
+
+void PlatformScreenOzone::IncreaseResolution(int64_t display_id) {
+ // TODO(kylechar): Implement.
+ NOTIMPLEMENTED();
dcheng 2016/09/08 21:02:57 Would it be possible to just merge the implementat
kylechar 2016/09/08 21:20:53 It's not possible to implement yet. Removed.
+}
+
+void PlatformScreenOzone::DecreaseResolution(int64_t display_id) {
+ // TODO(kylechar): Implement.
+ NOTIMPLEMENTED();
+}
+
+void PlatformScreenOzone::UseDefaultResolution(int64_t display_id) {
+ // TODO(kylechar): Implement.
+ NOTIMPLEMENTED();
+}
+
void PlatformScreenOzone::ProcessRemovedDisplays(
const ui::DisplayConfigurator::DisplayStateList& snapshots) {
std::vector<int64_t> current_ids;
@@ -155,7 +189,7 @@ void PlatformScreenOzone::AddNewDisplays(
primary_display_id_ = id;
cached_displays_.push_back(DisplayInfo(id, bounds));
- delegate_->OnDisplayAdded(this, id, bounds);
+ delegate_->OnDisplayAdded(id, bounds);
}
}
« no previous file with comments | « services/ui/display/platform_screen_ozone.h ('k') | services/ui/display/platform_screen_ozone_unittests.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698