| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 "views/view.h" | 5 #include "views/view.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #ifndef NDEBUG | 8 #ifndef NDEBUG |
| 9 #include <iostream> | 9 #include <iostream> |
| 10 #endif | 10 #endif |
| (...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 211 } | 211 } |
| 212 } | 212 } |
| 213 | 213 |
| 214 ///////////////////////////////////////////////////////////////////////////// | 214 ///////////////////////////////////////////////////////////////////////////// |
| 215 // | 215 // |
| 216 // View - layout | 216 // View - layout |
| 217 // | 217 // |
| 218 ///////////////////////////////////////////////////////////////////////////// | 218 ///////////////////////////////////////////////////////////////////////////// |
| 219 | 219 |
| 220 void View::Layout() { | 220 void View::Layout() { |
| 221 // Layout child Views | 221 // If we have a layout manager, let it handle the layout for us. |
| 222 if (layout_manager_.get()) { | 222 if (layout_manager_.get()) { |
| 223 layout_manager_->Layout(this); | 223 layout_manager_->Layout(this); |
| 224 SchedulePaint(); | 224 SchedulePaint(); |
| 225 // TODO(beng): We believe the right thing to do here is return since the | 225 return; |
| 226 // layout manager should be handling things, but it causes | |
| 227 // regressions (missing options from Options dialog and a hang | |
| 228 // in interactive_ui_tests). | |
| 229 } | 226 } |
| 230 | 227 |
| 231 // Lay out contents of child Views | 228 // Otherwise, just pass on to the child views. |
| 232 for (int i = 0, count = GetChildViewCount(); i < count; ++i) { | 229 for (int i = 0, count = GetChildViewCount(); i < count; ++i) { |
| 233 View* child = GetChildViewAt(i); | 230 View* child = GetChildViewAt(i); |
| 234 child->Layout(); | 231 child->Layout(); |
| 235 } | 232 } |
| 236 } | 233 } |
| 237 | 234 |
| 238 LayoutManager* View::GetLayoutManager() const { | 235 LayoutManager* View::GetLayoutManager() const { |
| 239 return layout_manager_.get(); | 236 return layout_manager_.get(); |
| 240 } | 237 } |
| 241 | 238 |
| (...skipping 1266 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1508 possible_drag = false; | 1505 possible_drag = false; |
| 1509 start_pt = gfx::Point(); | 1506 start_pt = gfx::Point(); |
| 1510 } | 1507 } |
| 1511 | 1508 |
| 1512 void View::DragInfo::PossibleDrag(const gfx::Point& p) { | 1509 void View::DragInfo::PossibleDrag(const gfx::Point& p) { |
| 1513 possible_drag = true; | 1510 possible_drag = true; |
| 1514 start_pt = p; | 1511 start_pt = p; |
| 1515 } | 1512 } |
| 1516 | 1513 |
| 1517 } // namespace | 1514 } // namespace |
| OLD | NEW |