Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/status_area_layout_manager.h" | 5 #include "ash/wm/status_area_layout_manager.h" |
| 6 | 6 |
| 7 #include "ash/wm/shelf_layout_manager.h" | 7 #include "ash/wm/shelf_layout_manager.h" |
| 8 #include "base/auto_reset.h" | 8 #include "base/auto_reset.h" |
| 9 #include "ui/aura/window.h" | 9 #include "ui/aura/window.h" |
| 10 #include "ui/views/widget/widget.h" | 10 #include "ui/views/widget/widget.h" |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 49 const gfx::Rect& requested_bounds) { | 49 const gfx::Rect& requested_bounds) { |
| 50 // Only need to have the shelf do a layout if the child changing is the status | 50 // Only need to have the shelf do a layout if the child changing is the status |
| 51 // area and the shelf isn't in the process of doing a layout. | 51 // area and the shelf isn't in the process of doing a layout. |
| 52 if (child != shelf_->status()->GetNativeView() || in_layout_) { | 52 if (child != shelf_->status()->GetNativeView() || in_layout_) { |
| 53 SetChildBoundsDirect(child, requested_bounds); | 53 SetChildBoundsDirect(child, requested_bounds); |
| 54 return; | 54 return; |
| 55 } | 55 } |
| 56 | 56 |
| 57 // If the size matches, no need to do anything. We don't check the location as | 57 // If the size matches, no need to do anything. We don't check the location as |
| 58 // that is managed by the shelf. | 58 // that is managed by the shelf. |
| 59 if (requested_bounds.size() == child->bounds().size()) | 59 if (requested_bounds == child->bounds()) |
|
sadrul
2012/05/17 19:57:05
Is this change because the size doesn't change whe
jennyz
2012/05/17 22:13:30
Yes.
| |
| 60 return; | 60 return; |
| 61 | 61 |
| 62 SetChildBoundsDirect(child, requested_bounds); | 62 SetChildBoundsDirect(child, requested_bounds); |
| 63 LayoutStatusArea(); | 63 LayoutStatusArea(); |
| 64 } | 64 } |
| 65 | 65 |
| 66 //////////////////////////////////////////////////////////////////////////////// | 66 //////////////////////////////////////////////////////////////////////////////// |
| 67 // StatusAreaLayoutManager, private: | 67 // StatusAreaLayoutManager, private: |
| 68 | 68 |
| 69 void StatusAreaLayoutManager::LayoutStatusArea() { | 69 void StatusAreaLayoutManager::LayoutStatusArea() { |
| 70 // Shelf layout manager may be already doing layout. | 70 // Shelf layout manager may be already doing layout. |
| 71 if (shelf_->in_layout()) | 71 if (shelf_->in_layout()) |
| 72 return; | 72 return; |
| 73 | 73 |
| 74 AutoReset<bool> auto_reset_in_layout(&in_layout_, true); | 74 AutoReset<bool> auto_reset_in_layout(&in_layout_, true); |
| 75 shelf_->LayoutShelf(); | 75 shelf_->LayoutShelf(); |
| 76 } | 76 } |
| 77 | 77 |
| 78 } // namespace internal | 78 } // namespace internal |
| 79 } // namespace ash | 79 } // namespace ash |
| OLD | NEW |