| 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/app_list/app_list_presenter_delegate.h" | 5 #include "ash/app_list/app_list_presenter_delegate.h" |
| 6 | 6 |
| 7 #include "ash/aura/wm_window_aura.h" | 7 #include "ash/aura/wm_window_aura.h" |
| 8 #include "ash/common/ash_switches.h" | 8 #include "ash/common/ash_switches.h" |
| 9 #include "ash/common/shelf/app_list_button.h" | 9 #include "ash/common/shelf/app_list_button.h" |
| 10 #include "ash/common/shelf/shelf_layout_manager.h" | 10 #include "ash/common/shelf/shelf_layout_manager.h" |
| (...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 115 AppListButton* applist_button = shelf->shelf_widget()->GetAppListButton(); | 115 AppListButton* applist_button = shelf->shelf_widget()->GetAppListButton(); |
| 116 bool is_fullscreen = IsFullscreenAppListEnabled() && | 116 bool is_fullscreen = IsFullscreenAppListEnabled() && |
| 117 WmShell::Get() | 117 WmShell::Get() |
| 118 ->maximize_mode_controller() | 118 ->maximize_mode_controller() |
| 119 ->IsMaximizeModeWindowManagerEnabled(); | 119 ->IsMaximizeModeWindowManagerEnabled(); |
| 120 if (is_fullscreen) { | 120 if (is_fullscreen) { |
| 121 view->InitAsFramelessWindow( | 121 view->InitAsFramelessWindow( |
| 122 container, current_apps_page, | 122 container, current_apps_page, |
| 123 ScreenUtil::GetDisplayWorkAreaBoundsInParent(container)); | 123 ScreenUtil::GetDisplayWorkAreaBoundsInParent(container)); |
| 124 } else { | 124 } else { |
| 125 // Note: We can't center the app list until we have its dimensions, so we | 125 view->InitAsBubble(container, current_apps_page); |
| 126 // init at (0, 0) and then reset its anchor point. | |
| 127 view->InitAsBubbleAtFixedLocation(container, current_apps_page, | |
| 128 gfx::Point(), views::BubbleBorder::FLOAT, | |
| 129 true /* border_accepts_events */); | |
| 130 // The app list is centered over the display of the app list button that was | 126 // The app list is centered over the display of the app list button that was |
| 131 // pressed (if triggered via keyboard, this is the display with the | 127 // pressed (if triggered via keyboard, this is the display with the |
| 132 // currently focused window). | 128 // currently focused window). |
| 133 view->SetAnchorPoint(GetCenterOfDisplayForView( | 129 view->SetAnchorPoint(GetCenterOfDisplayForView( |
| 134 applist_button, GetMinimumBoundsHeightForAppList(view))); | 130 applist_button, GetMinimumBoundsHeightForAppList(view))); |
| 135 } | 131 } |
| 136 | 132 |
| 137 keyboard::KeyboardController* keyboard_controller = | 133 keyboard::KeyboardController* keyboard_controller = |
| 138 keyboard::KeyboardController::GetInstance(); | 134 keyboard::KeyboardController::GetInstance(); |
| 139 if (keyboard_controller) | 135 if (keyboard_controller) |
| (...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 281 } | 277 } |
| 282 | 278 |
| 283 //////////////////////////////////////////////////////////////////////////////// | 279 //////////////////////////////////////////////////////////////////////////////// |
| 284 // AppListPresenterDelegate, WmShelfObserver implementation: | 280 // AppListPresenterDelegate, WmShelfObserver implementation: |
| 285 | 281 |
| 286 void AppListPresenterDelegate::OnShelfIconPositionsChanged() { | 282 void AppListPresenterDelegate::OnShelfIconPositionsChanged() { |
| 287 UpdateBounds(); | 283 UpdateBounds(); |
| 288 } | 284 } |
| 289 | 285 |
| 290 } // namespace ash | 286 } // namespace ash |
| OLD | NEW |