summaryrefslogtreecommitdiffstats
path: root/ui
diff options
context:
space:
mode:
authorxiyuan@chromium.org <xiyuan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-12-06 07:43:12 +0000
committerxiyuan@chromium.org <xiyuan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-12-06 07:43:12 +0000
commit9aef60e231fe17da81406af1ee431df2a077b971 (patch)
treea3101452b9b38282fa7ae2f549a620bd224d3741 /ui
parent086bc9a3a3b941f19988fd7796ea0afe7f11f6aa (diff)
downloadchromium_src-9aef60e231fe17da81406af1ee431df2a077b971.zip
chromium_src-9aef60e231fe17da81406af1ee431df2a077b971.tar.gz
chromium_src-9aef60e231fe17da81406af1ee431df2a077b971.tar.bz2
[Aura] Polish app list.
- Remove search box until we have decided how to approach it; - Show apps pagination dots; - Dismiss app list UI on escape or click on non-app and non nav dots; - Defer widget showing further until apps are loaded by webui; - Add a container div to limit apps page height so that the gap between apps icons and nav dots are not too big; - Passing bounds when requesting app list widget to avoid resizing; BUG=98308,105794,106451 TEST=Verify search box is gone, nav gots show up on bottom and could switch pages by clicking on it; Review URL: http://codereview.chromium.org/8747021 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@113156 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui')
-rw-r--r--ui/aura_shell/app_list.cc4
-rw-r--r--ui/aura_shell/examples/aura_shell_main.cc6
-rw-r--r--ui/aura_shell/shell_delegate.h8
3 files changed, 14 insertions, 4 deletions
diff --git a/ui/aura_shell/app_list.cc b/ui/aura_shell/app_list.cc
index 0218713..d6f6f76 100644
--- a/ui/aura_shell/app_list.cc
+++ b/ui/aura_shell/app_list.cc
@@ -62,6 +62,7 @@ void AppList::SetVisible(bool visible) {
ScheduleAnimation();
} else if (is_visible_ && !set_widget_factory_.HasWeakPtrs()) {
Shell::GetInstance()->delegate()->RequestAppListWidget(
+ GetPreferredBounds(false),
base::Bind(&AppList::SetWidget, set_widget_factory_.GetWeakPtr()));
}
}
@@ -88,7 +89,6 @@ void AppList::SetWidget(views::Widget* widget) {
ScheduleAnimation();
widget_->Show();
- widget_->Activate();
} else {
widget->Close();
}
@@ -162,6 +162,8 @@ void AppList::OnLayerAnimationScheduled(
void AppList::OnWidgetClosing(views::Widget* widget) {
DCHECK(widget_ == widget);
+ if (is_visible_)
+ SetVisible(false);
ResetWidget();
}
diff --git a/ui/aura_shell/examples/aura_shell_main.cc b/ui/aura_shell/examples/aura_shell_main.cc
index 56e7690..e15957f 100644
--- a/ui/aura_shell/examples/aura_shell_main.cc
+++ b/ui/aura_shell/examples/aura_shell_main.cc
@@ -28,11 +28,12 @@ class AppListWindow : public views::WidgetDelegateView {
}
// static
- static views::Widget* Create() {
+ 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;
@@ -66,8 +67,9 @@ class ShellDelegateImpl : public aura_shell::ShellDelegate {
}
virtual void RequestAppListWidget(
+ const gfx::Rect& bounds,
const SetWidgetCallback& callback) OVERRIDE {
- callback.Run(AppListWindow::Create());
+ callback.Run(AppListWindow::Create(bounds));
}
virtual void LauncherItemClicked(
diff --git a/ui/aura_shell/shell_delegate.h b/ui/aura_shell/shell_delegate.h
index 28eb602..3771b1a 100644
--- a/ui/aura_shell/shell_delegate.h
+++ b/ui/aura_shell/shell_delegate.h
@@ -9,6 +9,10 @@
#include "base/callback.h"
#include "ui/aura_shell/aura_shell_export.h"
+namespace gfx {
+class Rect;
+}
+
namespace views {
class Widget;
}
@@ -35,7 +39,9 @@ class AURA_SHELL_EXPORT ShellDelegate {
// Invoked to create app list widget. The Delegate calls the callback
// when the widget is ready to show.
- virtual void RequestAppListWidget(const SetWidgetCallback& callback) = 0;
+ virtual void RequestAppListWidget(
+ const gfx::Rect& bounds,
+ const SetWidgetCallback& callback) = 0;
// Invoked when the user clicks on a window entry in the launcher.
virtual void LauncherItemClicked(const LauncherItem& item) = 0;