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

Side by Side Diff: ash/common/shelf/wm_shelf.cc

Issue 2228713003: mash: Convert ShelfView to wm common types, clean up Shelf access (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix control reaches end of non-void function warnings Created 4 years, 4 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 | « ash/common/shelf/wm_shelf.h ('k') | ash/common/shelf/wm_shelf_util.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "ash/common/shelf/wm_shelf.h"
6
7 #include "base/logging.h"
8
9 namespace ash {
10
11 bool WmShelf::IsHorizontalAlignment() const {
12 switch (GetAlignment()) {
13 case SHELF_ALIGNMENT_BOTTOM:
14 case SHELF_ALIGNMENT_BOTTOM_LOCKED:
15 return true;
16 case SHELF_ALIGNMENT_LEFT:
17 case SHELF_ALIGNMENT_RIGHT:
18 return false;
19 }
20 NOTREACHED();
21 return true;
22 }
23
24 int WmShelf::SelectValueForShelfAlignment(int bottom,
25 int left,
26 int right) const {
27 switch (GetAlignment()) {
28 case SHELF_ALIGNMENT_BOTTOM:
29 case SHELF_ALIGNMENT_BOTTOM_LOCKED:
30 return bottom;
31 case SHELF_ALIGNMENT_LEFT:
32 return left;
33 case SHELF_ALIGNMENT_RIGHT:
34 return right;
35 }
36 NOTREACHED();
37 return bottom;
38 }
39
40 int WmShelf::PrimaryAxisValue(int horizontal, int vertical) const {
41 return IsHorizontalAlignment() ? horizontal : vertical;
42 }
43
44 } // namespace ash
OLDNEW
« no previous file with comments | « ash/common/shelf/wm_shelf.h ('k') | ash/common/shelf/wm_shelf_util.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698