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 <cmath> | 7 #include <cmath> |
8 #include <limits> | 8 #include <limits> |
9 | 9 |
10 #include "athena/common/container_priorities.h" | 10 #include "athena/common/container_priorities.h" |
(...skipping 274 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
285 void SetState(HomeCard::State state) { | 285 void SetState(HomeCard::State state) { |
286 bottom_view_->SetVisible(state == HomeCard::VISIBLE_BOTTOM); | 286 bottom_view_->SetVisible(state == HomeCard::VISIBLE_BOTTOM); |
287 main_view_->SetVisible(state == HomeCard::VISIBLE_CENTERED); | 287 main_view_->SetVisible(state == HomeCard::VISIBLE_CENTERED); |
288 minimized_view_->SetVisible(state == HomeCard::VISIBLE_MINIMIZED); | 288 minimized_view_->SetVisible(state == HomeCard::VISIBLE_MINIMIZED); |
289 if (state == HomeCard::VISIBLE_CENTERED) { | 289 if (state == HomeCard::VISIBLE_CENTERED) { |
290 app_list::ContentsView* contents_view = main_view_->contents_view(); | 290 app_list::ContentsView* contents_view = main_view_->contents_view(); |
291 contents_view->SetActivePage(contents_view->GetPageIndexForNamedPage( | 291 contents_view->SetActivePage(contents_view->GetPageIndexForNamedPage( |
292 app_list::ContentsView::NAMED_PAGE_START)); | 292 app_list::ContentsView::NAMED_PAGE_START)); |
293 } | 293 } |
294 wm::SetShadowType(GetWidget()->GetNativeView(), | 294 wm::SetShadowType(GetWidget()->GetNativeView(), |
295 state == HomeCard::VISIBLE_MINIMIZED ? | 295 state == HomeCard::VISIBLE_MINIMIZED |
296 wm::SHADOW_TYPE_NONE : | 296 ? wm::SHADOW_TYPE_NONE |
297 wm::SHADOW_TYPE_RECTANGULAR); | 297 : wm::SHADOW_TYPE_RECTANGULAR); |
298 } | 298 } |
299 | 299 |
300 void ClearGesture() { | 300 void ClearGesture() { |
301 gesture_manager_.reset(); | 301 gesture_manager_.reset(); |
302 } | 302 } |
303 | 303 |
304 // views::View: | 304 // views::View: |
305 virtual void Layout() OVERRIDE { | 305 virtual void Layout() OVERRIDE { |
306 for (int i = 0; i < child_count(); ++i) { | 306 for (int i = 0; i < child_count(); ++i) { |
307 views::View* child = child_at(i); | 307 views::View* child = child_at(i); |
(...skipping 271 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
579 instance = NULL; | 579 instance = NULL; |
580 } | 580 } |
581 | 581 |
582 // static | 582 // static |
583 HomeCard* HomeCard::Get() { | 583 HomeCard* HomeCard::Get() { |
584 DCHECK(instance); | 584 DCHECK(instance); |
585 return instance; | 585 return instance; |
586 } | 586 } |
587 | 587 |
588 } // namespace athena | 588 } // namespace athena |
OLD | NEW |