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

Unified Diff: ash/shell/app_list.cc

Issue 10388032: Move app list from ash to ui. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: fix nits in #3 Created 8 years, 7 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
Index: ash/shell/app_list.cc
===================================================================
--- ash/shell/app_list.cc (revision 135932)
+++ ash/shell/app_list.cc (working copy)
@@ -2,16 +2,16 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "ash/app_list/app_list_item_model.h"
-#include "ash/app_list/app_list_item_view.h"
-#include "ash/app_list/app_list_model.h"
-#include "ash/app_list/app_list_view.h"
-#include "ash/app_list/app_list_view_delegate.h"
#include "ash/shell.h"
#include "ash/shell_delegate.h"
#include "ash/shell/example_factory.h"
#include "ash/shell/toplevel_window.h"
#include "base/basictypes.h"
+#include "ui/app_list/app_list_item_model.h"
+#include "ui/app_list/app_list_item_view.h"
+#include "ui/app_list/app_list_model.h"
+#include "ui/app_list/app_list_view.h"
+#include "ui/app_list/app_list_view_delegate.h"
#include "ui/views/examples/examples_window.h"
namespace ash {
@@ -19,7 +19,7 @@
namespace {
-class WindowTypeLauncherItem : public ash::AppListItemModel {
+class WindowTypeLauncherItem : public app_list::AppListItemModel {
public:
enum Type {
TOPLEVEL_WINDOW = 0,
@@ -30,7 +30,7 @@
LAST_TYPE,
};
- WindowTypeLauncherItem(Type type) : type_(type) {
+ explicit WindowTypeLauncherItem(Type type) : type_(type) {
SetIcon(GetIcon(type));
SetTitle(GetTitle(type));
}
@@ -108,13 +108,13 @@
DISALLOW_COPY_AND_ASSIGN(WindowTypeLauncherItem);
};
-class ExampleAppListViewDelegate : public ash::AppListViewDelegate {
+class ExampleAppListViewDelegate : public app_list::AppListViewDelegate {
public:
ExampleAppListViewDelegate() : model_(NULL) {}
private:
// Overridden from ash::AppListViewDelegate:
- virtual void SetModel(AppListModel* model) OVERRIDE {
+ virtual void SetModel(app_list::AppListModel* model) OVERRIDE {
model_ = model;
}
@@ -133,19 +133,25 @@
}
}
- virtual void OnAppListItemActivated(ash::AppListItemModel* item,
+ virtual void OnAppListItemActivated(app_list::AppListItemModel* item,
int event_flags) OVERRIDE {
static_cast<WindowTypeLauncherItem*>(item)->Activate(event_flags);
}
- AppListModel* model_;
+ virtual void Close() OVERRIDE {
+ DCHECK(ash::Shell::HasInstance());
+ if (Shell::GetInstance()->GetAppListTargetVisibility())
+ Shell::GetInstance()->ToggleAppList();
+ }
+ app_list::AppListModel* model_;
+
DISALLOW_COPY_AND_ASSIGN(ExampleAppListViewDelegate);
};
} // namespace
-ash::AppListViewDelegate* CreateAppListViewDelegate() {
+app_list::AppListViewDelegate* CreateAppListViewDelegate() {
return new ExampleAppListViewDelegate;
}
« no previous file with comments | « ash/shell.cc ('k') | ash/shell/example_factory.h » ('j') | ash/wm/app_list_controller.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698