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

Unified Diff: ash/app_list/app_list.cc

Issue 9559005: aura: Implement app list M19 mock. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix nit in #2 Created 8 years, 10 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 | « no previous file | ash/app_list/app_list_groups_view.h » ('j') | ash/app_list/app_list_item_view.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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();
« no previous file with comments | « no previous file | ash/app_list/app_list_groups_view.h » ('j') | ash/app_list/app_list_item_view.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698