| 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/ash_switches.h" | 7 #include "ash/ash_switches.h" |
| 8 #include "ash/public/cpp/shelf_types.h" | 8 #include "ash/public/cpp/shelf_types.h" |
| 9 #include "ash/public/cpp/shell_window_ids.h" | 9 #include "ash/public/cpp/shell_window_ids.h" |
| 10 #include "ash/root_window_controller.h" | 10 #include "ash/root_window_controller.h" |
| 11 #include "ash/screen_util.h" | 11 #include "ash/screen_util.h" |
| 12 #include "ash/shelf/app_list_button.h" | 12 #include "ash/shelf/app_list_button.h" |
| 13 #include "ash/shelf/shelf.h" | 13 #include "ash/shelf/shelf.h" |
| 14 #include "ash/shelf/shelf_layout_manager.h" | 14 #include "ash/shelf/shelf_layout_manager.h" |
| 15 #include "ash/shelf/shelf_widget.h" | 15 #include "ash/shelf/shelf_widget.h" |
| 16 #include "ash/shell.h" | 16 #include "ash/shell.h" |
| 17 #include "ash/wm/maximize_mode/maximize_mode_controller.h" | 17 #include "ash/wm/maximize_mode/maximize_mode_controller.h" |
| 18 #include "ash/wm/window_state.h" |
| 18 #include "base/command_line.h" | 19 #include "base/command_line.h" |
| 19 #include "ui/app_list/app_list_constants.h" | 20 #include "ui/app_list/app_list_constants.h" |
| 20 #include "ui/app_list/app_list_features.h" | 21 #include "ui/app_list/app_list_features.h" |
| 21 #include "ui/app_list/app_list_switches.h" | 22 #include "ui/app_list/app_list_switches.h" |
| 22 #include "ui/app_list/presenter/app_list_presenter_impl.h" | 23 #include "ui/app_list/presenter/app_list_presenter_impl.h" |
| 23 #include "ui/app_list/presenter/app_list_view_delegate_factory.h" | 24 #include "ui/app_list/presenter/app_list_view_delegate_factory.h" |
| 24 #include "ui/app_list/views/app_list_view.h" | 25 #include "ui/app_list/views/app_list_view.h" |
| 25 #include "ui/aura/window.h" | 26 #include "ui/aura/window.h" |
| 26 #include "ui/events/event.h" | 27 #include "ui/events/event.h" |
| 27 #include "ui/keyboard/keyboard_controller.h" | 28 #include "ui/keyboard/keyboard_controller.h" |
| (...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 113 view->Initialize(container, current_apps_page, | 114 view->Initialize(container, current_apps_page, |
| 114 Shell::Get() | 115 Shell::Get() |
| 115 ->maximize_mode_controller() | 116 ->maximize_mode_controller() |
| 116 ->IsMaximizeModeWindowManagerEnabled(), | 117 ->IsMaximizeModeWindowManagerEnabled(), |
| 117 IsSideShelf(root_window)); | 118 IsSideShelf(root_window)); |
| 118 | 119 |
| 119 if (!app_list::features::IsFullscreenAppListEnabled()) { | 120 if (!app_list::features::IsFullscreenAppListEnabled()) { |
| 120 view->MaybeSetAnchorPoint(GetCenterOfDisplayForWindow( | 121 view->MaybeSetAnchorPoint(GetCenterOfDisplayForWindow( |
| 121 root_window, GetMinimumBoundsHeightForAppList(view))); | 122 root_window, GetMinimumBoundsHeightForAppList(view))); |
| 122 } | 123 } |
| 124 wm::GetWindowState(view->GetWidget()->GetNativeWindow()) |
| 125 ->set_ignored_by_shelf(true); |
| 123 keyboard::KeyboardController* keyboard_controller = | 126 keyboard::KeyboardController* keyboard_controller = |
| 124 keyboard::KeyboardController::GetInstance(); | 127 keyboard::KeyboardController::GetInstance(); |
| 125 if (keyboard_controller) | 128 if (keyboard_controller) |
| 126 keyboard_controller->AddObserver(this); | 129 keyboard_controller->AddObserver(this); |
| 127 Shell::Get()->AddPreTargetHandler(this); | 130 Shell::Get()->AddPreTargetHandler(this); |
| 128 | 131 |
| 129 // By setting us as DnD recipient, the app list knows that we can | 132 // By setting us as DnD recipient, the app list knows that we can |
| 130 // handle items. | 133 // handle items. |
| 131 Shelf* shelf = Shelf::ForWindow(root_window); | 134 Shelf* shelf = Shelf::ForWindow(root_window); |
| 132 view->SetDragAndDropHostOfCurrentAppList( | 135 view->SetDragAndDropHostOfCurrentAppList( |
| (...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 252 } | 255 } |
| 253 | 256 |
| 254 void AppListPresenterDelegate::OnMaximizeModeEnded() { | 257 void AppListPresenterDelegate::OnMaximizeModeEnded() { |
| 255 if (!app_list::features::IsFullscreenAppListEnabled()) | 258 if (!app_list::features::IsFullscreenAppListEnabled()) |
| 256 return; | 259 return; |
| 257 | 260 |
| 258 view_->OnMaximizeModeChanged(false); | 261 view_->OnMaximizeModeChanged(false); |
| 259 } | 262 } |
| 260 | 263 |
| 261 } // namespace ash | 264 } // namespace ash |
| OLD | NEW |