| 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" |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 92 // UI layout when AppListView visibility changes. | 92 // UI layout when AppListView visibility changes. |
| 93 ash::Shell::GetPrimaryRootWindowController() | 93 ash::Shell::GetPrimaryRootWindowController() |
| 94 ->GetShelfLayoutManager() | 94 ->GetShelfLayoutManager() |
| 95 ->UpdateAutoHideState(); | 95 ->UpdateAutoHideState(); |
| 96 view_ = view; | 96 view_ = view; |
| 97 WmWindow* wm_root_window = | 97 WmWindow* wm_root_window = |
| 98 ShellPort::Get()->GetRootWindowForDisplayId(display_id); | 98 ShellPort::Get()->GetRootWindowForDisplayId(display_id); |
| 99 aura::Window* root_window = wm_root_window->aura_window(); | 99 aura::Window* root_window = wm_root_window->aura_window(); |
| 100 aura::Window* container = GetRootWindowController(root_window) | 100 aura::Window* container = GetRootWindowController(root_window) |
| 101 ->GetContainer(kShellWindowId_AppListContainer); | 101 ->GetContainer(kShellWindowId_AppListContainer); |
| 102 view->InitAsBubble(container, current_apps_page); | 102 view->Initialize( |
| 103 // The app list is centered over the display. | 103 container, current_apps_page, |
| 104 view->SetAnchorPoint(GetCenterOfDisplayForWindow( | 104 ash::ScreenUtil::GetDisplayWorkAreaBoundsInParent(container)); |
| 105 wm_root_window, GetMinimumBoundsHeightForAppList(view))); | |
| 106 | 105 |
| 106 if (!base::CommandLine::ForCurrentProcess()->HasSwitch( |
| 107 app_list::switches::kEnableFullscreenAppList)) { |
| 108 view->SetAnchorPoint(GetCenterOfDisplayForWindow( |
| 109 wm_root_window, GetMinimumBoundsHeightForAppList(view))); |
| 110 } |
| 107 keyboard::KeyboardController* keyboard_controller = | 111 keyboard::KeyboardController* keyboard_controller = |
| 108 keyboard::KeyboardController::GetInstance(); | 112 keyboard::KeyboardController::GetInstance(); |
| 109 if (keyboard_controller) | 113 if (keyboard_controller) |
| 110 keyboard_controller->AddObserver(this); | 114 keyboard_controller->AddObserver(this); |
| 111 Shell::Get()->AddPreTargetHandler(this); | 115 Shell::Get()->AddPreTargetHandler(this); |
| 112 WmShelf* shelf = WmShelf::ForWindow(wm_root_window); | 116 WmShelf* shelf = WmShelf::ForWindow(wm_root_window); |
| 113 shelf->AddObserver(this); | 117 shelf->AddObserver(this); |
| 114 | 118 |
| 115 // By setting us as DnD recipient, the app list knows that we can | 119 // By setting us as DnD recipient, the app list knows that we can |
| 116 // handle items. | 120 // handle items. |
| (...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 239 } | 243 } |
| 240 | 244 |
| 241 //////////////////////////////////////////////////////////////////////////////// | 245 //////////////////////////////////////////////////////////////////////////////// |
| 242 // AppListPresenterDelegate, WmShelfObserver implementation: | 246 // AppListPresenterDelegate, WmShelfObserver implementation: |
| 243 | 247 |
| 244 void AppListPresenterDelegate::OnShelfIconPositionsChanged() { | 248 void AppListPresenterDelegate::OnShelfIconPositionsChanged() { |
| 245 UpdateBounds(); | 249 UpdateBounds(); |
| 246 } | 250 } |
| 247 | 251 |
| 248 } // namespace ash | 252 } // namespace ash |
| OLD | NEW |