summaryrefslogtreecommitdiffstats
path: root/ash/wm/app_list_controller.cc
diff options
context:
space:
mode:
authorharrym@chromium.org <harrym@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-07-02 00:25:04 +0000
committerharrym@chromium.org <harrym@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-07-02 00:25:04 +0000
commit2ff9e6ce7a34ef362fe00f0f33eb109cad2d6e89 (patch)
tree2e4fc174ba5831e48c11d59491fab9e684f4068d /ash/wm/app_list_controller.cc
parenta4ca8afc664596d6141e827dd8a7ad674bddb4d7 (diff)
downloadchromium_src-2ff9e6ce7a34ef362fe00f0f33eb109cad2d6e89.zip
chromium_src-2ff9e6ce7a34ef362fe00f0f33eb109cad2d6e89.tar.gz
chromium_src-2ff9e6ce7a34ef362fe00f0f33eb109cad2d6e89.tar.bz2
App list icon changes
Create a separate flow for the app list icon (behind alternate-shelf-layout flag) whereby the app list icon has different state indication (background images), can be reordered, and defaults to be the first item in the launcher. BUG=244994 Review URL: https://chromiumcodereview.appspot.com/16831018 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@209556 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ash/wm/app_list_controller.cc')
-rw-r--r--ash/wm/app_list_controller.cc32
1 files changed, 25 insertions, 7 deletions
diff --git a/ash/wm/app_list_controller.cc b/ash/wm/app_list_controller.cc
index a13ba65..96b90f6 100644
--- a/ash/wm/app_list_controller.cc
+++ b/ash/wm/app_list_controller.cc
@@ -121,13 +121,31 @@ void AppListController::SetVisible(bool visible, aura::Window* window) {
Shell::GetInstance()->delegate()->CreateAppListViewDelegate());
aura::Window* container = GetRootWindowController(window->GetRootWindow())->
GetContainer(kShellWindowId_AppListContainer);
- view->InitAsBubble(
- container,
- pagination_model_.get(),
- Launcher::ForWindow(container)->GetAppListButtonView(),
- gfx::Point(),
- GetBubbleArrow(container),
- true /* border_accepts_events */);
+ // TODO(harrym): find a better solution for this.
+ if (ash::switches::UseAlternateShelfLayout()) {
+ gfx::Rect applist_button_bounds = Launcher::ForWindow(container)->
+ GetAppListButtonView()->GetBoundsInScreen();
+ gfx::Point anchor = applist_button_bounds.origin();
+ if (anchor.x() == 0)
+ anchor.set_x(applist_button_bounds.right());
+ if (anchor.y() == 0)
+ anchor.set_y(applist_button_bounds.bottom());
+ view->InitAsBubble(
+ container,
+ pagination_model_.get(),
+ NULL,
+ anchor,
+ GetBubbleArrow(container),
+ true /* border_accepts_events */);
+ } else {
+ view->InitAsBubble(
+ container,
+ pagination_model_.get(),
+ Launcher::ForWindow(container)->GetAppListButtonView(),
+ gfx::Point(),
+ GetBubbleArrow(container),
+ true /* border_accepts_events */);
+ }
if (ash::switches::UseAlternateShelfLayout())
view->SetArrowPaintType(views::BubbleBorder::PAINT_NONE);
SetView(view);