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

Unified Diff: ui/aura_shell/examples/aura_shell_main.cc

Issue 9023004: Revert 115515 - [Aura] Implement views-based applist. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: 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/examples/app_list.cc ('k') | ui/aura_shell/examples/example_factory.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/aura_shell/examples/aura_shell_main.cc
===================================================================
--- ui/aura_shell/examples/aura_shell_main.cc (revision 115517)
+++ ui/aura_shell/examples/aura_shell_main.cc (working copy)
@@ -8,7 +8,6 @@
#include "base/memory/scoped_ptr.h"
#include "base/message_loop.h"
#include "ui/aura/root_window.h"
-#include "ui/aura_shell/examples/example_factory.h"
#include "ui/aura_shell/examples/toplevel_window.h"
#include "ui/aura_shell/launcher/launcher_types.h"
#include "ui/aura_shell/shell.h"
@@ -24,6 +23,34 @@
namespace {
+class AppListWindow : public views::WidgetDelegateView {
+ public:
+ AppListWindow() {
+ }
+
+ // static
+ static views::Widget* Create(const gfx::Rect& bounds) {
+ AppListWindow* app_list = new AppListWindow;
+
+ views::Widget::InitParams widget_params(
+ views::Widget::InitParams::TYPE_WINDOW_FRAMELESS);
+ widget_params.bounds = bounds;
+ widget_params.delegate = app_list;
+ widget_params.keep_on_top = true;
+ widget_params.transparent = true;
+
+ views::Widget* widget = new views::Widget;
+ widget->Init(widget_params);
+ widget->SetContentsView(app_list);
+ return widget;
+ }
+
+ // Overridden from views::View:
+ virtual void OnPaint(gfx::Canvas* canvas) OVERRIDE {
+ canvas->FillRect(SkColorSetARGB(0x4F, 0xFF, 0, 0), bounds());
+ }
+};
+
class ShellDelegateImpl : public aura_shell::ShellDelegate {
public:
ShellDelegateImpl() {
@@ -43,21 +70,9 @@
virtual void RequestAppListWidget(
const gfx::Rect& bounds,
const SetWidgetCallback& callback) OVERRIDE {
- // TODO(xiyuan): Clean this up.
- // The code below here is because we don't want to use
- // --aura-views-applist. This function is deprecated and all code
- // here will be removed when we clean it up.
- aura_shell::examples::CreateAppList(bounds, callback);
+ callback.Run(AppListWindow::Create(bounds));
}
- virtual void BuildAppListModel(aura_shell::AppListModel* model) {
- aura_shell::examples::BuildAppListModel(model);
- }
-
- virtual aura_shell::AppListViewDelegate* CreateAppListViewDelegate() {
- return aura_shell::examples::CreateAppListViewDelegate();
- }
-
virtual void LauncherItemClicked(
const aura_shell::LauncherItem& item) OVERRIDE {
aura_shell::ActivateWindow(item.window);
« no previous file with comments | « ui/aura_shell/examples/app_list.cc ('k') | ui/aura_shell/examples/example_factory.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698