Chromium Code Reviews| Index: ash/display/display_controller.cc |
| diff --git a/ash/display/display_controller.cc b/ash/display/display_controller.cc |
| index a4eceb48bb21abb1c6697eb46ab5557eebcdd370..2154f0ae206edd4808fffa99bc7eeca8214034a5 100644 |
| --- a/ash/display/display_controller.cc |
| +++ b/ash/display/display_controller.cc |
| @@ -23,7 +23,8 @@ namespace ash { |
| namespace internal { |
| DisplayController::DisplayController() |
| - : secondary_display_layout_(RIGHT) { |
| + : secondary_display_layout_(RIGHT), |
| + secondary_display_offset_(0) { |
| aura::Env::GetInstance()->display_manager()->AddObserver(this); |
| } |
| @@ -120,6 +121,11 @@ void DisplayController::SetSecondaryDisplayLayout( |
| UpdateDisplayBoundsForLayout(); |
| } |
| +void DisplayController::SetSecondaryDisplayOffset(int offset) { |
| + secondary_display_offset_ = offset; |
| + UpdateDisplayBoundsForLayout(); |
| +} |
| + |
| bool DisplayController::WarpMouseCursorIfNecessary( |
| aura::RootWindow* current_root, |
| const gfx::Point& point_in_root) { |
| @@ -237,16 +243,20 @@ void DisplayController::UpdateDisplayBoundsForLayout() { |
| // TODO(oshima|mukai): Implement more flexible layout. |
| switch (secondary_display_layout_) { |
| case TOP: |
| - new_secondary_origin.Offset(0, -secondary_bounds.height()); |
| + new_secondary_origin.Offset( |
| + secondary_display_offset_, -secondary_bounds.height()); |
| break; |
| case RIGHT: |
| - new_secondary_origin.Offset(primary_bounds.width(), 0); |
| + new_secondary_origin.Offset( |
| + primary_bounds.width(), secondary_display_offset_); |
| break; |
| case BOTTOM: |
| - new_secondary_origin.Offset(0, primary_bounds.height()); |
| + new_secondary_origin.Offset( |
| + secondary_display_offset_, primary_bounds.height()); |
| break; |
| case LEFT: |
| - new_secondary_origin.Offset(-secondary_bounds.width(), 0); |
| + new_secondary_origin.Offset( |
| + -secondary_bounds.width(), secondary_display_offset_); |
| break; |
| } |
|
oshima
2012/08/06 04:15:55
you need to check & adjust the offset if the secon
Jun Mukai
2012/08/06 05:27:27
Added the check for offset value above.
|
| gfx::Insets insets = secondary_display->GetWorkAreaInsets(); |