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/root_window_controller.h" | 5 #include "ash/root_window_controller.h" |
6 | 6 |
7 #include <queue> | 7 #include <queue> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "ash/ash_constants.h" | 10 #include "ash/ash_constants.h" |
(...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
230 } | 230 } |
231 | 231 |
232 void RootWindowController::CreateForVirtualKeyboardDisplay( | 232 void RootWindowController::CreateForVirtualKeyboardDisplay( |
233 aura::RootWindow * root) { | 233 aura::RootWindow * root) { |
234 RootWindowController* controller = new RootWindowController(root); | 234 RootWindowController* controller = new RootWindowController(root); |
235 controller->Init(RootWindowController::VIRTUAL_KEYBOARD, | 235 controller->Init(RootWindowController::VIRTUAL_KEYBOARD, |
236 false /* first run */); | 236 false /* first run */); |
237 } | 237 } |
238 | 238 |
239 // static | 239 // static |
240 RootWindowController* RootWindowController::ForLauncher(aura::Window* window) { | 240 RootWindowController* RootWindowController::ForShelf(aura::Window* window) { |
241 return GetRootWindowController(window->GetRootWindow()); | 241 return GetRootWindowController(window->GetRootWindow()); |
242 } | 242 } |
243 | 243 |
244 // static | 244 // static |
245 RootWindowController* RootWindowController::ForWindow( | 245 RootWindowController* RootWindowController::ForWindow( |
246 const aura::Window* window) { | 246 const aura::Window* window) { |
247 return GetRootWindowController(window->GetRootWindow()); | 247 return GetRootWindowController(window->GetRootWindow()); |
248 } | 248 } |
249 | 249 |
250 // static | 250 // static |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
335 } | 335 } |
336 | 336 |
337 aura::Window* RootWindowController::GetContainer(int container_id) { | 337 aura::Window* RootWindowController::GetContainer(int container_id) { |
338 return root_window()->GetChildById(container_id); | 338 return root_window()->GetChildById(container_id); |
339 } | 339 } |
340 | 340 |
341 const aura::Window* RootWindowController::GetContainer(int container_id) const { | 341 const aura::Window* RootWindowController::GetContainer(int container_id) const { |
342 return root_window_->window()->GetChildById(container_id); | 342 return root_window_->window()->GetChildById(container_id); |
343 } | 343 } |
344 | 344 |
345 void RootWindowController::ShowLauncher() { | 345 void RootWindowController::ShowShelf() { |
346 if (!shelf_->launcher()) | 346 if (!shelf_->shelf()) |
347 return; | 347 return; |
348 shelf_->launcher()->SetVisible(true); | 348 shelf_->shelf()->SetVisible(true); |
349 shelf_->status_area_widget()->Show(); | 349 shelf_->status_area_widget()->Show(); |
350 } | 350 } |
351 | 351 |
352 void RootWindowController::OnLauncherCreated() { | 352 void RootWindowController::OnShelfCreated() { |
353 if (panel_layout_manager_) | 353 if (panel_layout_manager_) |
354 panel_layout_manager_->SetLauncher(shelf_->launcher()); | 354 panel_layout_manager_->SetShelf(shelf_->shelf()); |
355 if (docked_layout_manager_) { | 355 if (docked_layout_manager_) { |
356 docked_layout_manager_->SetLauncher(shelf_->launcher()); | 356 docked_layout_manager_->SetShelf(shelf_->shelf()); |
357 if (shelf_->shelf_layout_manager()) | 357 if (shelf_->shelf_layout_manager()) |
358 docked_layout_manager_->AddObserver(shelf_->shelf_layout_manager()); | 358 docked_layout_manager_->AddObserver(shelf_->shelf_layout_manager()); |
359 } | 359 } |
360 } | 360 } |
361 | 361 |
362 void RootWindowController::UpdateAfterLoginStatusChange( | 362 void RootWindowController::UpdateAfterLoginStatusChange( |
363 user::LoginStatus status) { | 363 user::LoginStatus status) { |
364 if (status != user::LOGGED_IN_NONE) | 364 if (status != user::LOGGED_IN_NONE) |
365 mouse_event_target_.reset(); | 365 mouse_event_target_.reset(); |
366 if (shelf_->status_area_widget()) | 366 if (shelf_->status_area_widget()) |
(...skipping 271 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
638 root_window_layout()->OnWindowResized(); | 638 root_window_layout()->OnWindowResized(); |
639 if (!keyboard::IsKeyboardUsabilityExperimentEnabled()) | 639 if (!keyboard::IsKeyboardUsabilityExperimentEnabled()) |
640 shell->InitKeyboard(); | 640 shell->InitKeyboard(); |
641 } else { | 641 } else { |
642 root_window_layout()->OnWindowResized(); | 642 root_window_layout()->OnWindowResized(); |
643 shell->desktop_background_controller()->OnRootWindowAdded(root_window()); | 643 shell->desktop_background_controller()->OnRootWindowAdded(root_window()); |
644 shell->high_contrast_controller()->OnRootWindowAdded( | 644 shell->high_contrast_controller()->OnRootWindowAdded( |
645 root_window_->window()); | 645 root_window_->window()); |
646 root_window_->host()->Show(); | 646 root_window_->host()->Show(); |
647 | 647 |
648 // Create a launcher if a user is already logged in. | 648 // Create a shelf if a user is already logged in. |
649 if (shell->session_state_delegate()->NumberOfLoggedInUsers()) | 649 if (shell->session_state_delegate()->NumberOfLoggedInUsers()) |
650 shelf()->CreateLauncher(); | 650 shelf()->CreateShelf(); |
651 } | 651 } |
652 | 652 |
653 solo_window_tracker_.reset(new SoloWindowTracker(root_window_.get())); | 653 solo_window_tracker_.reset(new SoloWindowTracker(root_window_.get())); |
654 if (docked_layout_manager_) | 654 if (docked_layout_manager_) |
655 docked_layout_manager_->AddObserver(solo_window_tracker_.get()); | 655 docked_layout_manager_->AddObserver(solo_window_tracker_.get()); |
656 } | 656 } |
657 | 657 |
658 void RootWindowController::InitLayoutManagers() { | 658 void RootWindowController::InitLayoutManagers() { |
659 root_window_layout_ = new RootWindowLayoutManager(root_window()); | 659 root_window_layout_ = new RootWindowLayoutManager(root_window()); |
660 root_window()->SetLayoutManager(root_window_layout_); | 660 root_window()->SetLayoutManager(root_window_layout_); |
(...skipping 282 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
943 DisableTouchHudProjection(); | 943 DisableTouchHudProjection(); |
944 } | 944 } |
945 | 945 |
946 RootWindowController* GetRootWindowController( | 946 RootWindowController* GetRootWindowController( |
947 const aura::Window* root_window) { | 947 const aura::Window* root_window) { |
948 return root_window ? GetRootWindowSettings(root_window)->controller : NULL; | 948 return root_window ? GetRootWindowSettings(root_window)->controller : NULL; |
949 } | 949 } |
950 | 950 |
951 } // namespace internal | 951 } // namespace internal |
952 } // namespace ash | 952 } // namespace ash |
OLD | NEW |