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 #ifndef UI_VIEWS_VIEW_MODEL_UTILS_H_ | 5 #ifndef UI_VIEWS_VIEW_MODEL_UTILS_H_ |
6 #define UI_VIEWS_VIEW_MODEL_UTILS_H_ | 6 #define UI_VIEWS_VIEW_MODEL_UTILS_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
10 #include "ui/views/views_export.h" | 10 #include "ui/views/views_export.h" |
11 | 11 |
12 namespace views { | 12 namespace views { |
13 | 13 |
14 class View; | 14 class View; |
15 class ViewModel; | 15 class ViewModel; |
16 | 16 |
17 class VIEWS_EXPORT ViewModelUtils { | 17 class VIEWS_EXPORT ViewModelUtils { |
18 public: | 18 public: |
19 // Sets the bounds of each view to its ideal bounds. | 19 // Sets the bounds of each view to its ideal bounds. |
20 static void SetViewBoundsToIdealBounds(const ViewModel& model); | 20 static void SetViewBoundsToIdealBounds(const ViewModel& model); |
21 | 21 |
| 22 // Sets the visibility of each view to its ideal visibility. |
| 23 static void SetViewVisibilityToIdealVisibility(const ViewModel& model); |
| 24 |
22 // Returns the index to move |view| to based on a x-coordinate of |x|. | 25 // Returns the index to move |view| to based on a x-coordinate of |x|. |
23 static int DetermineMoveIndex(const ViewModel& model, | 26 static int DetermineMoveIndex(const ViewModel& model, |
24 View* view, | 27 View* view, |
25 int x); | 28 int x); |
26 | 29 |
27 private: | 30 private: |
28 DISALLOW_IMPLICIT_CONSTRUCTORS(ViewModelUtils); | 31 DISALLOW_IMPLICIT_CONSTRUCTORS(ViewModelUtils); |
29 }; | 32 }; |
30 | 33 |
31 } // namespace views | 34 } // namespace views |
32 | 35 |
33 #endif // UI_VIEWS_VIEW_MODEL_UTILS_H_ | 36 #endif // UI_VIEWS_VIEW_MODEL_UTILS_H_ |
OLD | NEW |