OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "ash/wm/app_list_controller.h" | 5 #include "ash/wm/app_list_controller.h" |
6 | 6 |
7 #include "ash/ash_switches.h" | 7 #include "ash/ash_switches.h" |
8 #include "ash/root_window_controller.h" | 8 #include "ash/root_window_controller.h" |
9 #include "ash/screen_util.h" | 9 #include "ash/screen_util.h" |
10 #include "ash/shelf/shelf.h" | 10 #include "ash/shelf/shelf.h" |
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
169 GetContainer(kShellWindowId_AppListContainer); | 169 GetContainer(kShellWindowId_AppListContainer); |
170 if (CommandLine::ForCurrentProcess()->HasSwitch( | 170 if (CommandLine::ForCurrentProcess()->HasSwitch( |
171 app_list::switches::kEnableExperimentalAppList)) { | 171 app_list::switches::kEnableExperimentalAppList)) { |
172 // The experimental app list is centered over the primary display. | 172 // The experimental app list is centered over the primary display. |
173 view->InitAsBubbleAtFixedLocation( | 173 view->InitAsBubbleAtFixedLocation( |
174 NULL, | 174 NULL, |
175 pagination_model_.get(), | 175 pagination_model_.get(), |
176 Shell::GetScreen()->GetPrimaryDisplay().bounds().CenterPoint(), | 176 Shell::GetScreen()->GetPrimaryDisplay().bounds().CenterPoint(), |
177 views::BubbleBorder::FLOAT, | 177 views::BubbleBorder::FLOAT, |
178 true /* border_accepts_events */); | 178 true /* border_accepts_events */); |
179 } else if (ash::switches::UseAlternateShelfLayout()) { | |
180 gfx::Rect applist_button_bounds = Shelf::ForWindow(container)-> | |
181 GetAppListButtonView()->GetBoundsInScreen(); | |
182 // We need the location of the button within the local screen. | |
183 applist_button_bounds = ScreenUtil::ConvertRectFromScreen( | |
184 root_window, | |
185 applist_button_bounds); | |
186 view->InitAsBubbleAttachedToAnchor( | |
187 container, | |
188 pagination_model_.get(), | |
189 Shelf::ForWindow(container)->GetAppListButtonView(), | |
190 GetAnchorPositionOffsetToShelf(applist_button_bounds, | |
191 Shelf::ForWindow(container)->GetAppListButtonView()-> | |
192 GetWidget()), | |
193 GetBubbleArrow(container), | |
194 true /* border_accepts_events */); | |
195 view->SetArrowPaintType(views::BubbleBorder::PAINT_NONE); | |
196 } else { | 179 } else { |
197 view->InitAsBubbleAttachedToAnchor( | 180 view->InitAsBubbleAttachedToAnchor( |
198 container, | 181 container, |
199 pagination_model_.get(), | 182 pagination_model_.get(), |
200 Shelf::ForWindow(container)->GetAppListButtonView(), | 183 Shelf::ForWindow(container)->GetAppListButtonView(), |
201 gfx::Vector2d(), | 184 gfx::Vector2d(), |
202 GetBubbleArrow(container), | 185 GetBubbleArrow(container), |
203 true /* border_accepts_events */); | 186 true /* border_accepts_events */); |
204 } | 187 } |
205 SetView(view); | 188 SetView(view); |
(...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
433 should_snap_back_ = false; | 416 should_snap_back_ = false; |
434 ui::ScopedLayerAnimationSettings animation(widget_animator); | 417 ui::ScopedLayerAnimationSettings animation(widget_animator); |
435 animation.SetTransitionDuration(base::TimeDelta::FromMilliseconds( | 418 animation.SetTransitionDuration(base::TimeDelta::FromMilliseconds( |
436 app_list::kOverscrollPageTransitionDurationMs)); | 419 app_list::kOverscrollPageTransitionDurationMs)); |
437 widget->SetBounds(view_bounds_); | 420 widget->SetBounds(view_bounds_); |
438 } | 421 } |
439 } | 422 } |
440 | 423 |
441 } // namespace internal | 424 } // namespace internal |
442 } // namespace ash | 425 } // namespace ash |
OLD | NEW |