Index: athena/home/home_card_impl.cc |
diff --git a/athena/home/home_card_impl.cc b/athena/home/home_card_impl.cc |
index 13723afb1794e51d0868bd5d677382f29f0a308e..2f1dd8ccd463f36b72df4101dfb163b3a0d1fca6 100644 |
--- a/athena/home/home_card_impl.cc |
+++ b/athena/home/home_card_impl.cc |
@@ -4,12 +4,11 @@ |
#include "athena/home/public/home_card.h" |
-#include "athena/home/app_list_view_delegate.h" |
+#include "athena/home/home_card_delegate_view.h" |
#include "athena/screen/public/screen_manager.h" |
-#include "ui/app_list/pagination_model.h" |
-#include "ui/app_list/views/app_list_view.h" |
#include "ui/aura/layout_manager.h" |
#include "ui/aura/window.h" |
+#include "ui/views/widget/widget.h" |
#include "ui/wm/core/visibility_controller.h" |
#include "ui/wm/core/window_animations.h" |
@@ -42,12 +41,8 @@ |
} |
void Layout() { |
- const int kHomeCardHeight = 150; |
+ const int kHomeCardHeight = 50; |
const int kHomeCardHorizontalMargin = 50; |
- // Currently the home card is provided as a bubble and the bounds has to be |
- // increased to cancel the shadow. |
- // TODO(mukai): stops using the bubble and remove this. |
- const int kHomeCardShadowWidth = 30; |
if (container_->children().size() < 1) |
return; |
aura::Window* home_card = container_->children()[0]; |
@@ -59,7 +54,6 @@ |
screen_bounds.height() - kHomeCardHeight, |
kHomeCardHorizontalMargin, |
0); |
- card_bounds.Inset(-kHomeCardShadowWidth, -kHomeCardShadowWidth); |
SetChildBoundsDirect(home_card, card_bounds); |
} |
@@ -81,8 +75,7 @@ |
DISALLOW_COPY_AND_ASSIGN(HomeCardImpl); |
}; |
-HomeCardImpl::HomeCardImpl() |
- : home_card_widget_(NULL) { |
+HomeCardImpl::HomeCardImpl() : home_card_widget_(NULL) { |
DCHECK(!instance); |
instance = this; |
} |
@@ -99,16 +92,23 @@ |
container->SetLayoutManager(new HomeCardLayoutManager(container)); |
wm::SetChildWindowVisibilityChangesAnimated(container); |
- app_list::AppListView* view = new app_list::AppListView( |
- new AppListViewDelegate); |
- view->InitAsBubbleAtFixedLocation( |
- container, |
- 0 /* initial_apps_page */, |
- gfx::Point(), |
- views::BubbleBorder::FLOAT, |
- true /* border_accepts_events */); |
- home_card_widget_ = view->GetWidget(); |
- view->ShowWhenReady(); |
+ views::Widget::InitParams params( |
+ views::Widget::InitParams::TYPE_WINDOW_FRAMELESS); |
+ params.opacity = views::Widget::InitParams::TRANSLUCENT_WINDOW; |
+ params.delegate = new HomeCardDelegateView(); |
+ params.parent = container; |
+ |
+ home_card_widget_ = new views::Widget; |
+ home_card_widget_->Init(params); |
+ home_card_widget_->GetNativeView()->SetName("HomeCardWidget"); |
+ |
+ aura::Window* home_card_window = home_card_widget_->GetNativeView(); |
+ wm::SetWindowVisibilityAnimationType( |
+ home_card_window, wm::WINDOW_VISIBILITY_ANIMATION_TYPE_FADE); |
+ wm::SetWindowVisibilityAnimationTransition(home_card_window, |
+ wm::ANIMATE_BOTH); |
+ |
+ home_card_widget_->Show(); |
} |
} // namespace |