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

Unified Diff: ash/display/display_manager.cc

Issue 289583002: Lock rotation when screen is manually rotated. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Define sources for rotation Created 6 years, 7 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
Index: ash/display/display_manager.cc
diff --git a/ash/display/display_manager.cc b/ash/display/display_manager.cc
index 9feca525dd5b3d160331e5abe1c476760200b23d..0cedb18539aff4a2dd1cef3ec6d7d13ab13be1e4 100644
--- a/ash/display/display_manager.cc
+++ b/ash/display/display_manager.cc
@@ -393,7 +393,8 @@ void DisplayManager::SetOverscanInsets(int64 display_id,
}
void DisplayManager::SetDisplayRotation(int64 display_id,
- gfx::Display::Rotation rotation) {
+ gfx::Display::Rotation rotation,
+ ui::RotationSource source) {
DisplayInfoList display_info_list;
for (DisplayList::const_iterator iter = displays_.begin();
iter != displays_.end(); ++iter) {
@@ -401,7 +402,7 @@ void DisplayManager::SetDisplayRotation(int64 display_id,
if (info.id() == display_id) {
if (info.rotation() == rotation)
return;
- info.set_rotation(rotation);
+ info.SetRotation(rotation, source);
}
display_info_list.push_back(info);
}
@@ -409,7 +410,7 @@ void DisplayManager::SetDisplayRotation(int64 display_id,
if (virtual_keyboard_root_window_enabled() &&
display_id == non_desktop_display_.id()) {
DisplayInfo info = GetDisplayInfo(display_id);
- info.set_rotation(rotation);
+ info.SetRotation(rotation, source);
display_info_list.push_back(info);
}
UpdateDisplays(display_info_list);
@@ -475,7 +476,7 @@ void DisplayManager::RegisterDisplayProperty(
if (display_info_.find(display_id) == display_info_.end())
display_info_[display_id] = DisplayInfo(display_id, std::string(), false);
- display_info_[display_id].set_rotation(rotation);
+ display_info_[display_id].SetRotation(rotation, ui::USER);
display_info_[display_id].SetColorProfile(color_profile);
// Just in case the preference file was corrupted.
if (0.5f <= ui_scale && ui_scale <= 2.0f)

Powered by Google App Engine
This is Rietveld 408576698