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_BUBBLE_BUBBLE_BORDER_H_ | 5 #ifndef UI_VIEWS_BUBBLE_BUBBLE_BORDER_H_ |
6 #define UI_VIEWS_BUBBLE_BUBBLE_BORDER_H_ | 6 #define UI_VIEWS_BUBBLE_BUBBLE_BORDER_H_ |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
10 #include "ui/views/background.h" | 10 #include "ui/views/background.h" |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
89 return (loc == TOP_CENTER || loc == BOTTOM_CENTER || loc >= NONE) ? | 89 return (loc == TOP_CENTER || loc == BOTTOM_CENTER || loc >= NONE) ? |
90 loc : static_cast<ArrowLocation>(loc ^ RIGHT); | 90 loc : static_cast<ArrowLocation>(loc ^ RIGHT); |
91 } | 91 } |
92 | 92 |
93 static ArrowLocation vertical_mirror(ArrowLocation loc) { | 93 static ArrowLocation vertical_mirror(ArrowLocation loc) { |
94 return (loc == LEFT_CENTER || loc == RIGHT_CENTER || loc >= NONE) ? | 94 return (loc == LEFT_CENTER || loc == RIGHT_CENTER || loc >= NONE) ? |
95 loc : static_cast<ArrowLocation>(loc ^ BOTTOM); | 95 loc : static_cast<ArrowLocation>(loc ^ BOTTOM); |
96 } | 96 } |
97 | 97 |
98 static bool has_arrow(ArrowLocation loc) { | 98 static bool has_arrow(ArrowLocation loc) { |
99 return loc >= NONE ? false : true; | 99 return loc < NONE; |
100 } | 100 } |
101 | 101 |
102 static bool is_arrow_on_left(ArrowLocation loc) { | 102 static bool is_arrow_on_left(ArrowLocation loc) { |
103 return (loc == TOP_CENTER || loc == BOTTOM_CENTER || loc >= NONE) ? | 103 return (loc == TOP_CENTER || loc == BOTTOM_CENTER || loc >= NONE) ? |
104 false : !(loc & RIGHT); | 104 false : !(loc & RIGHT); |
105 } | 105 } |
106 | 106 |
107 static bool is_arrow_on_top(ArrowLocation loc) { | 107 static bool is_arrow_on_top(ArrowLocation loc) { |
108 return (loc == LEFT_CENTER || loc == RIGHT_CENTER || loc >= NONE) ? | 108 return (loc == LEFT_CENTER || loc == RIGHT_CENTER || loc >= NONE) ? |
109 false : !(loc & BOTTOM); | 109 false : !(loc & BOTTOM); |
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
214 | 214 |
215 private: | 215 private: |
216 BubbleBorder* border_; | 216 BubbleBorder* border_; |
217 | 217 |
218 DISALLOW_COPY_AND_ASSIGN(BubbleBackground); | 218 DISALLOW_COPY_AND_ASSIGN(BubbleBackground); |
219 }; | 219 }; |
220 | 220 |
221 } // namespace views | 221 } // namespace views |
222 | 222 |
223 #endif // UI_VIEWS_BUBBLE_BUBBLE_BORDER_H_ | 223 #endif // UI_VIEWS_BUBBLE_BUBBLE_BORDER_H_ |
OLD | NEW |