Index: ash/app_list/app_list.cc |
diff --git a/ash/app_list/app_list.cc b/ash/app_list/app_list.cc |
index d9e30d1f63b203514e4c8892a898f5832ae13efb..edecd3f9ebde47bd231ea5afad0e90e2a0a8d8f5 100644 |
--- a/ash/app_list/app_list.cc |
+++ b/ash/app_list/app_list.cc |
@@ -4,7 +4,6 @@ |
#include "ash/app_list/app_list.h" |
-#include "ash/app_list/app_list_model.h" |
#include "ash/app_list/app_list_view.h" |
#include "ash/ash_switches.h" |
#include "ash/shell_delegate.h" |
@@ -22,19 +21,10 @@ namespace internal { |
namespace { |
-// Gets preferred bounds of app list window in show/hide state. |
-gfx::Rect GetPreferredBounds(bool show) { |
- // The y-axis offset used at the beginning of showing animation. |
- static const int kMoveUpAnimationOffset = 50; |
- |
+// Gets preferred bounds of app list window. |
+gfx::Rect GetPreferredBounds() { |
gfx::Point cursor = gfx::Screen::GetCursorScreenPoint(); |
- gfx::Rect work_area = gfx::Screen::GetMonitorWorkAreaNearestPoint(cursor); |
- gfx::Rect widget_bounds(work_area); |
- widget_bounds.Inset(100, 100); |
- if (!show) |
- widget_bounds.Offset(0, kMoveUpAnimationOffset); |
- |
- return widget_bounds; |
+ return gfx::Screen::GetMonitorAreaNearestPoint(cursor); |
sky
2012/03/01 00:26:57
You sure you don't want work area?
xiyuan
2012/03/01 19:58:47
Applist does not go behind the launcher in the moc
|
} |
ui::Layer* GetLayer(views::Widget* widget) { |
@@ -62,15 +52,11 @@ void AppList::SetVisible(bool visible) { |
if (widget_) { |
ScheduleAnimation(); |
} else if (is_visible_) { |
- scoped_ptr<AppListModel> model(new AppListModel); |
- Shell::GetInstance()->delegate()->BuildAppListModel(model.get()); |
- |
// AppListModel and AppListViewDelegate are owned by AppListView. They |
// will be released with AppListView on close. |
AppListView* app_list_view = new AppListView( |
- model.release(), |
Shell::GetInstance()->delegate()->CreateAppListViewDelegate(), |
- GetPreferredBounds(false)); |
+ GetPreferredBounds()); |
SetWidget(app_list_view->GetWidget()); |
} |
} |
@@ -90,11 +76,11 @@ void AppList::SetWidget(views::Widget* widget) { |
widget_->AddObserver(this); |
Shell::GetInstance()->AddRootWindowEventFilter(this); |
- widget_->SetBounds(GetPreferredBounds(false)); |
widget_->SetOpacity(0); |
ScheduleAnimation(); |
widget_->Show(); |
+ widget_->Activate(); |
} else { |
widget->Close(); |
} |
@@ -124,7 +110,6 @@ void AppList::ScheduleAnimation() { |
ui::ScopedLayerAnimationSettings app_list_animation(layer->GetAnimator()); |
app_list_animation.AddObserver(this); |
- layer->SetBounds(GetPreferredBounds(is_visible_)); |
layer->SetOpacity(is_visible_ ? 1.0 : 0.0); |
ui::Layer* default_container_layer = default_container->layer(); |