Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2)

Side by Side Diff: ui/views/view_model_utils.h

Issue 598013003: Added views::ViewModelT<T>, a type-safe template version of ViewModel. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@appsgridview-static-casts
Patch Set: Fix browser_test compile on ChromeOS (missing include). Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « ui/views/view_model.cc ('k') | ui/views/view_model_utils.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 7
8 #include "base/basictypes.h" 8 #include "base/basictypes.h"
9 #include "ui/views/views_export.h" 9 #include "ui/views/views_export.h"
10 10
11 namespace views { 11 namespace views {
12 12
13 class View; 13 class View;
14 class ViewModel; 14 class ViewModelBase;
15 15
16 class VIEWS_EXPORT ViewModelUtils { 16 class VIEWS_EXPORT ViewModelUtils {
17 public: 17 public:
18 enum Alignment { 18 enum Alignment {
19 HORIZONTAL, 19 HORIZONTAL,
20 VERTICAL 20 VERTICAL
21 }; 21 };
22 22
23 // Sets the bounds of each view to its ideal bounds. 23 // Sets the bounds of each view to its ideal bounds.
24 static void SetViewBoundsToIdealBounds(const ViewModel& model); 24 static void SetViewBoundsToIdealBounds(const ViewModelBase& model);
25 25
26 // Returns true if the Views in |model| are at their ideal bounds. 26 // Returns true if the Views in |model| are at their ideal bounds.
27 static bool IsAtIdealBounds(const ViewModel& model); 27 static bool IsAtIdealBounds(const ViewModelBase& model);
28 28
29 // Returns the index to move |view| to based on a coordinate of |x| and |y|. 29 // Returns the index to move |view| to based on a coordinate of |x| and |y|.
30 static int DetermineMoveIndex(const ViewModel& model, 30 static int DetermineMoveIndex(const ViewModelBase& model,
31 View* view, 31 View* view,
32 Alignment alignment, 32 Alignment alignment,
33 int x, 33 int x,
34 int y); 34 int y);
35 35
36 private: 36 private:
37 DISALLOW_IMPLICIT_CONSTRUCTORS(ViewModelUtils); 37 DISALLOW_IMPLICIT_CONSTRUCTORS(ViewModelUtils);
38 }; 38 };
39 39
40 } // namespace views 40 } // namespace views
41 41
42 #endif // UI_VIEWS_VIEW_MODEL_UTILS_H_ 42 #endif // UI_VIEWS_VIEW_MODEL_UTILS_H_
OLDNEW
« no previous file with comments | « ui/views/view_model.cc ('k') | ui/views/view_model_utils.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698