| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "ash/wm/compact_status_area_layout_manager.h" | 5 #include "ash/wm/compact_status_area_layout_manager.h" |
| 6 | 6 |
| 7 #include "ui/gfx/rect.h" | 7 #include "ui/gfx/rect.h" |
| 8 #include "ui/gfx/screen.h" | 8 #include "ui/gfx/screen.h" |
| 9 #include "ui/views/widget/widget.h" | 9 #include "ui/views/widget/widget.h" |
| 10 | 10 |
| 11 namespace { | 11 namespace { |
| 12 // Padding between the right edge of status area and right edge of screen. | 12 // Padding between the right edge of status area and right edge of screen. |
| 13 const int kRightEdgePad = 3; | 13 const int kRightEdgePad = 3; |
| 14 } // namespace | 14 } // namespace |
| 15 | 15 |
| 16 namespace aura_shell { | 16 namespace ash { |
| 17 namespace internal { | 17 namespace internal { |
| 18 | 18 |
| 19 //////////////////////////////////////////////////////////////////////////////// | 19 //////////////////////////////////////////////////////////////////////////////// |
| 20 // CompactStatusAreaLayoutManager, public: | 20 // CompactStatusAreaLayoutManager, public: |
| 21 | 21 |
| 22 CompactStatusAreaLayoutManager::CompactStatusAreaLayoutManager( | 22 CompactStatusAreaLayoutManager::CompactStatusAreaLayoutManager( |
| 23 views::Widget* status_widget) | 23 views::Widget* status_widget) |
| 24 : status_widget_(status_widget) { | 24 : status_widget_(status_widget) { |
| 25 } | 25 } |
| 26 | 26 |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 58 void CompactStatusAreaLayoutManager::LayoutStatusArea() { | 58 void CompactStatusAreaLayoutManager::LayoutStatusArea() { |
| 59 // Place the widget in the top-right corner of the screen. | 59 // Place the widget in the top-right corner of the screen. |
| 60 gfx::Rect monitor_bounds = gfx::Screen::GetPrimaryMonitorBounds(); | 60 gfx::Rect monitor_bounds = gfx::Screen::GetPrimaryMonitorBounds(); |
| 61 gfx::Rect widget_bounds = status_widget_->GetRestoredBounds(); | 61 gfx::Rect widget_bounds = status_widget_->GetRestoredBounds(); |
| 62 widget_bounds.set_x( | 62 widget_bounds.set_x( |
| 63 monitor_bounds.width() - widget_bounds.width() - kRightEdgePad); | 63 monitor_bounds.width() - widget_bounds.width() - kRightEdgePad); |
| 64 widget_bounds.set_y(0); | 64 widget_bounds.set_y(0); |
| 65 status_widget_->SetBounds(widget_bounds); | 65 status_widget_->SetBounds(widget_bounds); |
| 66 } | 66 } |
| 67 | 67 |
| 68 } // internal | 68 } // namespace internal |
| 69 } // aura_shell | 69 } // namespace ash |
| OLD | NEW |