| 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 232 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 243 | 243 |
| 244 void set_shelf(ShelfLayoutManager* shelf) { shelf_ = shelf; } | 244 void set_shelf(ShelfLayoutManager* shelf) { shelf_ = shelf; } |
| 245 | 245 |
| 246 // WorkspaceLayoutManagerDelegate: | 246 // WorkspaceLayoutManagerDelegate: |
| 247 void UpdateShelfVisibility() override { | 247 void UpdateShelfVisibility() override { |
| 248 if (shelf_) | 248 if (shelf_) |
| 249 shelf_->UpdateVisibilityState(); | 249 shelf_->UpdateVisibilityState(); |
| 250 } | 250 } |
| 251 void OnFullscreenStateChanged(bool is_fullscreen) override { | 251 void OnFullscreenStateChanged(bool is_fullscreen) override { |
| 252 if (shelf_) { | 252 if (shelf_) { |
| 253 ash::Shell::GetInstance()->NotifyFullscreenStateChange(is_fullscreen, | 253 ash::Shell::GetInstance()->NotifyFullscreenStateChange( |
| 254 root_window_); | 254 is_fullscreen, WmWindowAura::Get(root_window_)); |
| 255 } | 255 } |
| 256 } | 256 } |
| 257 | 257 |
| 258 private: | 258 private: |
| 259 aura::Window* root_window_; | 259 aura::Window* root_window_; |
| 260 ShelfLayoutManager* shelf_ = nullptr; | 260 ShelfLayoutManager* shelf_ = nullptr; |
| 261 | 261 |
| 262 DISALLOW_COPY_AND_ASSIGN(WorkspaceLayoutManagerDelegateImpl); | 262 DISALLOW_COPY_AND_ASSIGN(WorkspaceLayoutManagerDelegateImpl); |
| 263 }; | 263 }; |
| 264 | 264 |
| (...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 408 if (panel_layout_manager_) | 408 if (panel_layout_manager_) |
| 409 panel_layout_manager_->SetShelf(wm_shelf_aura_.get()); | 409 panel_layout_manager_->SetShelf(wm_shelf_aura_.get()); |
| 410 if (docked_layout_manager_) { | 410 if (docked_layout_manager_) { |
| 411 docked_layout_manager_->SetShelf(wm_shelf_aura_.get()); | 411 docked_layout_manager_->SetShelf(wm_shelf_aura_.get()); |
| 412 if (shelf_widget_->shelf_layout_manager()) | 412 if (shelf_widget_->shelf_layout_manager()) |
| 413 docked_layout_manager_->AddObserver( | 413 docked_layout_manager_->AddObserver( |
| 414 shelf_widget_->shelf_layout_manager()); | 414 shelf_widget_->shelf_layout_manager()); |
| 415 } | 415 } |
| 416 | 416 |
| 417 // Notify shell observers that the shelf has been created. | 417 // Notify shell observers that the shelf has been created. |
| 418 Shell::GetInstance()->OnShelfCreatedForRootWindow(GetRootWindow()); | 418 Shell::GetInstance()->OnShelfCreatedForRootWindow( |
| 419 WmWindowAura::Get(GetRootWindow())); |
| 419 | 420 |
| 420 shelf_widget_->PostCreateShelf(); | 421 shelf_widget_->PostCreateShelf(); |
| 421 } | 422 } |
| 422 | 423 |
| 423 Shelf* RootWindowController::GetShelf() const { | 424 Shelf* RootWindowController::GetShelf() const { |
| 424 // TODO(jamescook): Shelf should be owned by this class, not by ShelfWidget. | 425 // TODO(jamescook): Shelf should be owned by this class, not by ShelfWidget. |
| 425 return shelf_widget_->shelf(); | 426 return shelf_widget_->shelf(); |
| 426 } | 427 } |
| 427 | 428 |
| 428 void RootWindowController::UpdateAfterLoginStatusChange( | 429 void RootWindowController::UpdateAfterLoginStatusChange( |
| (...skipping 275 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 704 if (root_window_type == PRIMARY) { | 705 if (root_window_type == PRIMARY) { |
| 705 shell->InitKeyboard(); | 706 shell->InitKeyboard(); |
| 706 } else { | 707 } else { |
| 707 ash_host_->AsWindowTreeHost()->Show(); | 708 ash_host_->AsWindowTreeHost()->Show(); |
| 708 | 709 |
| 709 // Create a shelf if a user is already logged in. | 710 // Create a shelf if a user is already logged in. |
| 710 if (shell->session_state_delegate()->NumberOfLoggedInUsers()) | 711 if (shell->session_state_delegate()->NumberOfLoggedInUsers()) |
| 711 CreateShelf(); | 712 CreateShelf(); |
| 712 | 713 |
| 713 // Notify shell observers about new root window. | 714 // Notify shell observers about new root window. |
| 714 shell->OnRootWindowAdded(root_window); | 715 shell->OnRootWindowAdded(WmWindowAura::Get(root_window)); |
| 715 } | 716 } |
| 716 | 717 |
| 717 #if defined(OS_CHROMEOS) | 718 #if defined(OS_CHROMEOS) |
| 718 if (!base::CommandLine::ForCurrentProcess()->HasSwitch( | 719 if (!base::CommandLine::ForCurrentProcess()->HasSwitch( |
| 719 switches::kAshDisableTouchExplorationMode)) { | 720 switches::kAshDisableTouchExplorationMode)) { |
| 720 touch_exploration_manager_.reset(new AshTouchExplorationManager(this)); | 721 touch_exploration_manager_.reset(new AshTouchExplorationManager(this)); |
| 721 } | 722 } |
| 722 #endif | 723 #endif |
| 723 } | 724 } |
| 724 | 725 |
| (...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 887 aura::Window* primary_root_window = Shell::GetInstance() | 888 aura::Window* primary_root_window = Shell::GetInstance() |
| 888 ->window_tree_host_manager() | 889 ->window_tree_host_manager() |
| 889 ->GetPrimaryRootWindow(); | 890 ->GetPrimaryRootWindow(); |
| 890 return GetRootWindowSettings(primary_root_window)->controller; | 891 return GetRootWindowSettings(primary_root_window)->controller; |
| 891 } | 892 } |
| 892 | 893 |
| 893 return GetRootWindowSettings(root_window)->controller; | 894 return GetRootWindowSettings(root_window)->controller; |
| 894 } | 895 } |
| 895 | 896 |
| 896 } // namespace ash | 897 } // namespace ash |
| OLD | NEW |