OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "athena/home/public/home_card.h" | 5 #include "athena/home/public/home_card.h" |
6 | 6 |
7 #include <limits> | 7 #include <limits> |
8 | 8 |
9 #include "athena/home/app_list_view_delegate.h" | 9 #include "athena/home/app_list_view_delegate.h" |
10 #include "athena/home/bottom_home_view.h" | 10 #include "athena/home/bottom_home_view.h" |
(...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
192 | 192 |
193 switch (state_) { | 193 switch (state_) { |
194 case VISIBLE_CENTERED: | 194 case VISIBLE_CENTERED: |
195 // Span the screen fully. | 195 // Span the screen fully. |
196 return std::numeric_limits<int>::max(); | 196 return std::numeric_limits<int>::max(); |
197 case VISIBLE_BOTTOM: | 197 case VISIBLE_BOTTOM: |
198 return kHomeCardHeight; | 198 return kHomeCardHeight; |
199 case VISIBLE_MINIMIZED: | 199 case VISIBLE_MINIMIZED: |
200 return kHomeCardMinimizedHeight; | 200 return kHomeCardMinimizedHeight; |
201 case HIDDEN: | 201 case HIDDEN: |
202 NOTREACHED(); | 202 break; |
203 return -1; | |
204 } | 203 } |
| 204 NOTREACHED(); |
| 205 return -1; |
205 } | 206 } |
206 | 207 |
207 virtual int GetHorizontalMargin() const OVERRIDE { | 208 virtual int GetHorizontalMargin() const OVERRIDE { |
208 CHECK_NE(HIDDEN, state_); | 209 CHECK_NE(HIDDEN, state_); |
209 const int kHomeCardHorizontalMargin = 50; | 210 const int kHomeCardHorizontalMargin = 50; |
210 return state_ == VISIBLE_BOTTOM ? kHomeCardHorizontalMargin : 0; | 211 return state_ == VISIBLE_BOTTOM ? kHomeCardHorizontalMargin : 0; |
211 } | 212 } |
212 | 213 |
213 virtual aura::Window* GetNativeWindow() OVERRIDE { | 214 virtual aura::Window* GetNativeWindow() OVERRIDE { |
214 if (state_ == HIDDEN) | 215 if (state_ == HIDDEN) |
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
356 instance = NULL; | 357 instance = NULL; |
357 } | 358 } |
358 | 359 |
359 // static | 360 // static |
360 HomeCard* HomeCard::Get() { | 361 HomeCard* HomeCard::Get() { |
361 DCHECK(instance); | 362 DCHECK(instance); |
362 return instance; | 363 return instance; |
363 } | 364 } |
364 | 365 |
365 } // namespace athena | 366 } // namespace athena |
OLD | NEW |