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

Side by Side Diff: ash/wm/wm_types.cc

Issue 843763004: Use "static_assert" in lieu of "COMPILE_ASSERT" in ash module (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 11 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 | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "ash/wm/wm_types.h" 5 #include "ash/wm/wm_types.h"
6 6
7 #include "base/basictypes.h" 7 #include "base/basictypes.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 9
10 namespace ash { 10 namespace ash {
11 namespace wm { 11 namespace wm {
12 12
13 // This is to catch the change to WindowShowState. 13 // This is to catch the change to WindowShowState.
14 COMPILE_ASSERT( 14 static_assert(ui::SHOW_STATE_END ==
15 ui::SHOW_STATE_END == 15 static_cast<ui::WindowShowState>(WINDOW_STATE_TYPE_END),
16 static_cast<ui::WindowShowState>(WINDOW_STATE_TYPE_END), 16 "show enum mismatch");
17 show_enum_mismatch);
18 17
19 WindowStateType ToWindowStateType(ui::WindowShowState state) { 18 WindowStateType ToWindowStateType(ui::WindowShowState state) {
20 return static_cast<WindowStateType>(state); 19 return static_cast<WindowStateType>(state);
21 } 20 }
22 21
23 ui::WindowShowState ToWindowShowState(WindowStateType type) { 22 ui::WindowShowState ToWindowShowState(WindowStateType type) {
24 switch (type) { 23 switch (type) {
25 case WINDOW_STATE_TYPE_DEFAULT: 24 case WINDOW_STATE_TYPE_DEFAULT:
26 return ui::SHOW_STATE_DEFAULT; 25 return ui::SHOW_STATE_DEFAULT;
27 case WINDOW_STATE_TYPE_NORMAL: 26 case WINDOW_STATE_TYPE_NORMAL:
(...skipping 18 matching lines...) Expand all
46 return ui::SHOW_STATE_DEFAULT; 45 return ui::SHOW_STATE_DEFAULT;
47 } 46 }
48 47
49 bool IsMaximizedOrFullscreenWindowStateType(WindowStateType type) { 48 bool IsMaximizedOrFullscreenWindowStateType(WindowStateType type) {
50 return type == WINDOW_STATE_TYPE_MAXIMIZED || 49 return type == WINDOW_STATE_TYPE_MAXIMIZED ||
51 type == WINDOW_STATE_TYPE_FULLSCREEN; 50 type == WINDOW_STATE_TYPE_FULLSCREEN;
52 } 51 }
53 52
54 } // namespace wm 53 } // namespace wm
55 } // namespace ash 54 } // namespace ash
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698