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 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
112 | 113 |
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))); |
123 } else { | |
124 wm::GetWindowState(view->GetWidget()->GetNativeWindow()) | |
125 ->set_ignored_by_shelf(!IsSideShelf(root_window)); | |
oshima
2017/07/13 00:21:54
we should always set this to true, to keep the sam
Muyuan
2017/07/13 01:41:41
Done.
| |
122 } | 126 } |
123 keyboard::KeyboardController* keyboard_controller = | 127 keyboard::KeyboardController* keyboard_controller = |
124 keyboard::KeyboardController::GetInstance(); | 128 keyboard::KeyboardController::GetInstance(); |
125 if (keyboard_controller) | 129 if (keyboard_controller) |
126 keyboard_controller->AddObserver(this); | 130 keyboard_controller->AddObserver(this); |
127 Shell::Get()->AddPreTargetHandler(this); | 131 Shell::Get()->AddPreTargetHandler(this); |
128 | 132 |
129 // By setting us as DnD recipient, the app list knows that we can | 133 // By setting us as DnD recipient, the app list knows that we can |
130 // handle items. | 134 // handle items. |
131 Shelf* shelf = Shelf::ForWindow(root_window); | 135 Shelf* shelf = Shelf::ForWindow(root_window); |
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
252 } | 256 } |
253 | 257 |
254 void AppListPresenterDelegate::OnMaximizeModeEnded() { | 258 void AppListPresenterDelegate::OnMaximizeModeEnded() { |
255 if (!app_list::features::IsFullscreenAppListEnabled()) | 259 if (!app_list::features::IsFullscreenAppListEnabled()) |
256 return; | 260 return; |
257 | 261 |
258 view_->OnMaximizeModeChanged(false); | 262 view_->OnMaximizeModeChanged(false); |
259 } | 263 } |
260 | 264 |
261 } // namespace ash | 265 } // namespace ash |
OLD | NEW |