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

Unified Diff: athena/home/home_card_impl.cc

Issue 317163004: Replace the HomeCard by the AppList in Athena (2nd) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « athena/home/home_card_delegate_view.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: athena/home/home_card_impl.cc
diff --git a/athena/home/home_card_impl.cc b/athena/home/home_card_impl.cc
index 2f1dd8ccd463f36b72df4101dfb163b3a0d1fca6..13723afb1794e51d0868bd5d677382f29f0a308e 100644
--- a/athena/home/home_card_impl.cc
+++ b/athena/home/home_card_impl.cc
@@ -4,11 +4,12 @@
#include "athena/home/public/home_card.h"
-#include "athena/home/home_card_delegate_view.h"
+#include "athena/home/app_list_view_delegate.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"
@@ -41,8 +42,12 @@ class HomeCardLayoutManager : public aura::LayoutManager {
}
void Layout() {
- const int kHomeCardHeight = 50;
+ const int kHomeCardHeight = 150;
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];
@@ -54,6 +59,7 @@ class HomeCardLayoutManager : public aura::LayoutManager {
screen_bounds.height() - kHomeCardHeight,
kHomeCardHorizontalMargin,
0);
+ card_bounds.Inset(-kHomeCardShadowWidth, -kHomeCardShadowWidth);
SetChildBoundsDirect(home_card, card_bounds);
}
@@ -75,7 +81,8 @@ class HomeCardImpl : public HomeCard {
DISALLOW_COPY_AND_ASSIGN(HomeCardImpl);
};
-HomeCardImpl::HomeCardImpl() : home_card_widget_(NULL) {
+HomeCardImpl::HomeCardImpl()
+ : home_card_widget_(NULL) {
DCHECK(!instance);
instance = this;
}
@@ -92,23 +99,16 @@ void HomeCardImpl::Init() {
container->SetLayoutManager(new HomeCardLayoutManager(container));
wm::SetChildWindowVisibilityChangesAnimated(container);
- 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();
+ 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();
}
} // namespace
« no previous file with comments | « athena/home/home_card_delegate_view.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698