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

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

Issue 10388036: Adds the option of aligning the launcher to the left or right. There (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix compile Created 8 years, 7 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 | Annotate | Revision Log
« no previous file with comments | « ui/gfx/monitor.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 #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 enum Alignment {
20 HORIZONTAL,
21 VERTICAL
22 };
23
19 // Sets the bounds of each view to its ideal bounds. 24 // Sets the bounds of each view to its ideal bounds.
20 static void SetViewBoundsToIdealBounds(const ViewModel& model); 25 static void SetViewBoundsToIdealBounds(const ViewModel& model);
21 26
22 // Returns true if the Views in |model| are at their ideal bounds. 27 // Returns true if the Views in |model| are at their ideal bounds.
23 static bool IsAtIdealBounds(const ViewModel& model); 28 static bool IsAtIdealBounds(const ViewModel& model);
24 29
25 // Returns the index to move |view| to based on a x-coordinate of |x|. 30 // Returns the index to move |view| to based on a coordinate of |x| and |y|.
26 static int DetermineMoveIndex(const ViewModel& model, 31 static int DetermineMoveIndex(const ViewModel& model,
27 View* view, 32 View* view,
28 int x); 33 Alignment alignment,
34 int x,
35 int y);
29 36
30 private: 37 private:
31 DISALLOW_IMPLICIT_CONSTRUCTORS(ViewModelUtils); 38 DISALLOW_IMPLICIT_CONSTRUCTORS(ViewModelUtils);
32 }; 39 };
33 40
34 } // namespace views 41 } // namespace views
35 42
36 #endif // UI_VIEWS_VIEW_MODEL_UTILS_H_ 43 #endif // UI_VIEWS_VIEW_MODEL_UTILS_H_
OLDNEW
« no previous file with comments | « ui/gfx/monitor.cc ('k') | ui/views/view_model_utils.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698