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

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

Issue 8558031: [Aura] Refactor and update app list window. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: sync, change initial size close to final size to avoid CardSlider resize animation Created 9 years, 1 month 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/aura_shell.gyp ('k') | ui/aura_shell/launcher/launcher_view.cc » ('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
diff --git a/ui/aura_shell/examples/aura_shell_main.cc b/ui/aura_shell/examples/aura_shell_main.cc
index 9cacb3bacd6a16a8b123ca9861218e06f42c92b0..17e39234148e7c5bec0b49d944f02740e99ea746 100644
--- a/ui/aura_shell/examples/aura_shell_main.cc
+++ b/ui/aura_shell/examples/aura_shell_main.cc
@@ -15,10 +15,40 @@
#include "ui/aura_shell/shell_factory.h"
#include "ui/base/resource/resource_bundle.h"
#include "ui/base/ui_base_paths.h"
+#include "ui/gfx/canvas.h"
#include "ui/gfx/compositor/test/compositor_test_support.h"
+#include "views/widget/widget_delegate.h"
+#include "views/widget/widget.h"
namespace {
+class AppListWindow : public views::WidgetDelegateView {
+ public:
+ AppListWindow() {
+ }
+
+ // static
+ static views::Widget* Create() {
+ AppListWindow* app_list = new AppListWindow;
+
+ views::Widget::InitParams widget_params(
+ views::Widget::InitParams::TYPE_WINDOW_FRAMELESS);
+ 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() {
@@ -35,8 +65,9 @@ class ShellDelegateImpl : public aura_shell::ShellDelegate {
return aura_shell::internal::CreateStatusArea();
}
- virtual void ShowApps() OVERRIDE {
- NOTIMPLEMENTED();
+ virtual void RequestAppListWidget(
+ const SetWidgetCallback& callback) OVERRIDE {
+ callback.Run(AppListWindow::Create());
}
virtual void LauncherItemClicked(
« no previous file with comments | « ui/aura_shell/aura_shell.gyp ('k') | ui/aura_shell/launcher/launcher_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698