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

Unified Diff: ui/aura_shell/app_list/app_list.cc

Issue 8890049: [Aura] Implement views-based applist. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix win_aura Created 9 years 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 | « ui/aura_shell/app_list/app_list.h ('k') | ui/aura_shell/app_list/app_list_groups_view.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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()));
+ }
}
}
« no previous file with comments | « ui/aura_shell/app_list/app_list.h ('k') | ui/aura_shell/app_list/app_list_groups_view.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698