| Index: ui/aura_shell/app_list/app_list.cc
|
| diff --git a/ui/aura_shell/app_list.cc b/ui/aura_shell/app_list/app_list.cc
|
| similarity index 82%
|
| rename from ui/aura_shell/app_list.cc
|
| rename to ui/aura_shell/app_list/app_list.cc
|
| index 6e21601512b226ecb9572ecef4eeaa27c7ed4990..b68acb9e237ce9c5ff3e5a440994acfee6f9d856 100644
|
| --- a/ui/aura_shell/app_list.cc
|
| +++ b/ui/aura_shell/app_list/app_list.cc
|
| @@ -2,13 +2,17 @@
|
| // Use of this source code is governed by a BSD-style license that can be
|
| // found in the LICENSE file.
|
|
|
| -#include "ui/aura_shell/app_list.h"
|
| +#include "ui/aura_shell/app_list/app_list.h"
|
|
|
| #include "base/bind.h"
|
| +#include "base/command_line.h"
|
| #include "ui/aura/event.h"
|
| #include "ui/aura/window.h"
|
| -#include "ui/aura_shell/shell.h"
|
| +#include "ui/aura_shell/app_list/app_list_model.h"
|
| +#include "ui/aura_shell/app_list/app_list_view.h"
|
| +#include "ui/aura_shell/aura_shell_switches.h"
|
| #include "ui/aura_shell/shell_delegate.h"
|
| +#include "ui/aura_shell/shell.h"
|
| #include "ui/aura_shell/shell_window_ids.h"
|
| #include "ui/gfx/screen.h"
|
|
|
| @@ -25,7 +29,7 @@ gfx::Rect GetPreferredBounds(bool show) {
|
| gfx::Point cursor = gfx::Screen::GetCursorScreenPoint();
|
| gfx::Rect work_area = gfx::Screen::GetMonitorWorkAreaNearestPoint(cursor);
|
| gfx::Rect widget_bounds(work_area);
|
| - widget_bounds.Inset(150, 100);
|
| + widget_bounds.Inset(100, 100);
|
| if (!show)
|
| widget_bounds.Offset(0, kMoveUpAnimationOffset);
|
|
|
| @@ -61,9 +65,23 @@ void AppList::SetVisible(bool visible) {
|
| if (widget_) {
|
| ScheduleAnimation();
|
| } else if (is_visible_ && !set_widget_factory_.HasWeakPtrs()) {
|
| - Shell::GetInstance()->delegate()->RequestAppListWidget(
|
| - GetPreferredBounds(false),
|
| - base::Bind(&AppList::SetWidget, set_widget_factory_.GetWeakPtr()));
|
| + if (CommandLine::ForCurrentProcess()->HasSwitch(
|
| + switches::kAuraViewsAppList)) {
|
| + 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.
|
| + new AppListView(
|
| + model.release(),
|
| + Shell::GetInstance()->delegate()->CreateAppListViewDelegate(),
|
| + GetPreferredBounds(false),
|
| + base::Bind(&AppList::SetWidget, set_widget_factory_.GetWeakPtr()));
|
| + } else {
|
| + Shell::GetInstance()->delegate()->RequestAppListWidget(
|
| + GetPreferredBounds(false),
|
| + base::Bind(&AppList::SetWidget, set_widget_factory_.GetWeakPtr()));
|
| + }
|
| }
|
| }
|
|
|
|
|