Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(181)

Side by Side Diff: ash/root_window_controller.cc

Issue 2032613002: Converts RootWindowLayoutManager to common types (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « ash/root_window_controller.h ('k') | ash/root_window_controller_common.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 637 matching lines...) Expand 10 before | Expand all | Expand 10 after
648 bool RootWindowController::IsVirtualKeyboardWindow(aura::Window* window) { 648 bool RootWindowController::IsVirtualKeyboardWindow(aura::Window* window) {
649 aura::Window* parent = GetContainer(kShellWindowId_ImeWindowParentContainer); 649 aura::Window* parent = GetContainer(kShellWindowId_ImeWindowParentContainer);
650 return parent ? parent->Contains(window) : false; 650 return parent ? parent->Contains(window) : false;
651 } 651 }
652 652
653 //////////////////////////////////////////////////////////////////////////////// 653 ////////////////////////////////////////////////////////////////////////////////
654 // RootWindowController, private: 654 // RootWindowController, private:
655 655
656 RootWindowController::RootWindowController(AshWindowTreeHost* ash_host) 656 RootWindowController::RootWindowController(AshWindowTreeHost* ash_host)
657 : ash_host_(ash_host), 657 : ash_host_(ash_host),
658 root_window_layout_(NULL),
659 docked_layout_manager_(NULL), 658 docked_layout_manager_(NULL),
660 panel_layout_manager_(NULL), 659 panel_layout_manager_(NULL),
661 touch_hud_debug_(NULL), 660 touch_hud_debug_(NULL),
662 touch_hud_projection_(NULL) { 661 touch_hud_projection_(NULL) {
663 aura::Window* root_window = GetRootWindow(); 662 aura::Window* root_window = GetRootWindow();
664 root_window_controller_common_.reset( 663 root_window_controller_common_.reset(
665 new RootWindowControllerCommon(wm::WmWindowAura::Get(root_window))); 664 new RootWindowControllerCommon(wm::WmWindowAura::Get(root_window)));
666 GetRootWindowSettings(root_window)->controller = this; 665 GetRootWindowSettings(root_window)->controller = this;
667 666
668 stacking_controller_.reset(new StackingController); 667 stacking_controller_.reset(new StackingController);
(...skipping 14 matching lines...) Expand all
683 InitLayoutManagers(); 682 InitLayoutManagers();
684 InitTouchHuds(); 683 InitTouchHuds();
685 684
686 if (Shell::GetPrimaryRootWindowController()-> 685 if (Shell::GetPrimaryRootWindowController()->
687 GetSystemModalLayoutManager(NULL)->has_modal_background()) { 686 GetSystemModalLayoutManager(NULL)->has_modal_background()) {
688 GetSystemModalLayoutManager(NULL)->CreateModalBackground(); 687 GetSystemModalLayoutManager(NULL)->CreateModalBackground();
689 } 688 }
690 689
691 shell->AddShellObserver(this); 690 shell->AddShellObserver(this);
692 691
692 root_window_controller_common_->root_window_layout()->OnWindowResized();
693 if (root_window_type == PRIMARY) { 693 if (root_window_type == PRIMARY) {
694 root_window_layout()->OnWindowResized();
695 shell->InitKeyboard(); 694 shell->InitKeyboard();
696 } else { 695 } else {
697 root_window_layout()->OnWindowResized();
698 ash_host_->AsWindowTreeHost()->Show(); 696 ash_host_->AsWindowTreeHost()->Show();
699 697
700 // Create a shelf if a user is already logged in. 698 // Create a shelf if a user is already logged in.
701 if (shell->session_state_delegate()->NumberOfLoggedInUsers()) 699 if (shell->session_state_delegate()->NumberOfLoggedInUsers())
702 CreateShelf(); 700 CreateShelf();
703 701
704 // Notify shell observers about new root window. 702 // Notify shell observers about new root window.
705 shell->OnRootWindowAdded(root_window); 703 shell->OnRootWindowAdded(root_window);
706 } 704 }
707 705
708 #if defined(OS_CHROMEOS) 706 #if defined(OS_CHROMEOS)
709 if (!base::CommandLine::ForCurrentProcess()->HasSwitch( 707 if (!base::CommandLine::ForCurrentProcess()->HasSwitch(
710 switches::kAshDisableTouchExplorationMode)) { 708 switches::kAshDisableTouchExplorationMode)) {
711 touch_exploration_manager_.reset(new AshTouchExplorationManager(this)); 709 touch_exploration_manager_.reset(new AshTouchExplorationManager(this));
712 } 710 }
713 #endif 711 #endif
714 } 712 }
715 713
716 void RootWindowController::InitLayoutManagers() { 714 void RootWindowController::InitLayoutManagers() {
715 root_window_controller_common_->CreateLayoutManagers();
716
717 aura::Window* root_window = GetRootWindow(); 717 aura::Window* root_window = GetRootWindow();
718 root_window_layout_ = new RootWindowLayoutManager(root_window);
719 root_window->SetLayoutManager(root_window_layout_);
720 718
721 aura::Window* default_container = 719 aura::Window* default_container =
722 GetContainer(kShellWindowId_DefaultContainer); 720 GetContainer(kShellWindowId_DefaultContainer);
723 // Workspace manager has its own layout managers. 721 // Workspace manager has its own layout managers.
724 722
725 aura::Window* modal_container = 723 aura::Window* modal_container =
726 root_window->GetChildById(kShellWindowId_SystemModalContainer); 724 root_window->GetChildById(kShellWindowId_SystemModalContainer);
727 DCHECK(modal_container); 725 DCHECK(modal_container);
728 modal_container->SetLayoutManager( 726 modal_container->SetLayoutManager(
729 new SystemModalContainerLayoutManager(modal_container)); 727 new SystemModalContainerLayoutManager(modal_container));
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after
877 aura::Window* primary_root_window = Shell::GetInstance() 875 aura::Window* primary_root_window = Shell::GetInstance()
878 ->window_tree_host_manager() 876 ->window_tree_host_manager()
879 ->GetPrimaryRootWindow(); 877 ->GetPrimaryRootWindow();
880 return GetRootWindowSettings(primary_root_window)->controller; 878 return GetRootWindowSettings(primary_root_window)->controller;
881 } 879 }
882 880
883 return GetRootWindowSettings(root_window)->controller; 881 return GetRootWindowSettings(root_window)->controller;
884 } 882 }
885 883
886 } // namespace ash 884 } // namespace ash
OLDNEW
« no previous file with comments | « ash/root_window_controller.h ('k') | ash/root_window_controller_common.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698