| 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 404 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 415 void RootWindowController::UpdateAfterLoginStatusChange( | 415 void RootWindowController::UpdateAfterLoginStatusChange( |
| 416 user::LoginStatus status) { | 416 user::LoginStatus status) { |
| 417 if (status != user::LOGGED_IN_NONE) | 417 if (status != user::LOGGED_IN_NONE) |
| 418 mouse_event_target_.reset(); | 418 mouse_event_target_.reset(); |
| 419 if (shelf_->status_area_widget()) | 419 if (shelf_->status_area_widget()) |
| 420 shelf_->status_area_widget()->UpdateAfterLoginStatusChange(status); | 420 shelf_->status_area_widget()->UpdateAfterLoginStatusChange(status); |
| 421 } | 421 } |
| 422 | 422 |
| 423 void RootWindowController::HandleInitialDesktopBackgroundAnimationStarted() { | 423 void RootWindowController::HandleInitialDesktopBackgroundAnimationStarted() { |
| 424 #if defined(OS_CHROMEOS) | 424 #if defined(OS_CHROMEOS) |
| 425 if (CommandLine::ForCurrentProcess()->HasSwitch( | 425 if (base::CommandLine::ForCurrentProcess()->HasSwitch( |
| 426 switches::kAshAnimateFromBootSplashScreen) && | 426 switches::kAshAnimateFromBootSplashScreen) && |
| 427 boot_splash_screen_.get()) { | 427 boot_splash_screen_.get()) { |
| 428 // Make the splash screen fade out so it doesn't obscure the desktop | 428 // Make the splash screen fade out so it doesn't obscure the desktop |
| 429 // wallpaper's brightness/grayscale animation. | 429 // wallpaper's brightness/grayscale animation. |
| 430 boot_splash_screen_->StartHideAnimation( | 430 boot_splash_screen_->StartHideAnimation( |
| 431 base::TimeDelta::FromMilliseconds(kBootSplashScreenHideDurationMs)); | 431 base::TimeDelta::FromMilliseconds(kBootSplashScreenHideDurationMs)); |
| 432 } | 432 } |
| 433 #endif | 433 #endif |
| 434 } | 434 } |
| 435 | 435 |
| (...skipping 279 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 715 | 715 |
| 716 // Create a shelf if a user is already logged in. | 716 // Create a shelf if a user is already logged in. |
| 717 if (shell->session_state_delegate()->NumberOfLoggedInUsers()) | 717 if (shell->session_state_delegate()->NumberOfLoggedInUsers()) |
| 718 shelf()->CreateShelf(); | 718 shelf()->CreateShelf(); |
| 719 | 719 |
| 720 // Notify shell observers about new root window. | 720 // Notify shell observers about new root window. |
| 721 shell->OnRootWindowAdded(root_window); | 721 shell->OnRootWindowAdded(root_window); |
| 722 } | 722 } |
| 723 | 723 |
| 724 #if defined(OS_CHROMEOS) | 724 #if defined(OS_CHROMEOS) |
| 725 if (!CommandLine::ForCurrentProcess()->HasSwitch( | 725 if (!base::CommandLine::ForCurrentProcess()->HasSwitch( |
| 726 switches::kAshDisableTouchExplorationMode)) { | 726 switches::kAshDisableTouchExplorationMode)) { |
| 727 touch_exploration_manager_.reset(new AshTouchExplorationManager(this)); | 727 touch_exploration_manager_.reset(new AshTouchExplorationManager(this)); |
| 728 } | 728 } |
| 729 #endif | 729 #endif |
| 730 } | 730 } |
| 731 | 731 |
| 732 void RootWindowController::InitLayoutManagers() { | 732 void RootWindowController::InitLayoutManagers() { |
| 733 aura::Window* root_window = GetRootWindow(); | 733 aura::Window* root_window = GetRootWindow(); |
| 734 root_window_layout_ = new RootWindowLayoutManager(root_window); | 734 root_window_layout_ = new RootWindowLayoutManager(root_window); |
| 735 root_window->SetLayoutManager(root_window_layout_); | 735 root_window->SetLayoutManager(root_window_layout_); |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 793 gfx::Insets touch_extend = mouse_extend.Scale( | 793 gfx::Insets touch_extend = mouse_extend.Scale( |
| 794 kResizeOutsideBoundsScaleForTouch); | 794 kResizeOutsideBoundsScaleForTouch); |
| 795 panel_container->SetEventTargeter(scoped_ptr<ui::EventTargeter>( | 795 panel_container->SetEventTargeter(scoped_ptr<ui::EventTargeter>( |
| 796 new AttachedPanelWindowTargeter(panel_container, | 796 new AttachedPanelWindowTargeter(panel_container, |
| 797 mouse_extend, | 797 mouse_extend, |
| 798 touch_extend, | 798 touch_extend, |
| 799 panel_layout_manager_))); | 799 panel_layout_manager_))); |
| 800 } | 800 } |
| 801 | 801 |
| 802 void RootWindowController::InitTouchHuds() { | 802 void RootWindowController::InitTouchHuds() { |
| 803 CommandLine* command_line = CommandLine::ForCurrentProcess(); | 803 base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); |
| 804 if (command_line->HasSwitch(switches::kAshTouchHud)) | 804 if (command_line->HasSwitch(switches::kAshTouchHud)) |
| 805 set_touch_hud_debug(new TouchHudDebug(GetRootWindow())); | 805 set_touch_hud_debug(new TouchHudDebug(GetRootWindow())); |
| 806 if (Shell::GetInstance()->is_touch_hud_projection_enabled()) | 806 if (Shell::GetInstance()->is_touch_hud_projection_enabled()) |
| 807 EnableTouchHudProjection(); | 807 EnableTouchHudProjection(); |
| 808 } | 808 } |
| 809 | 809 |
| 810 void RootWindowController::CreateSystemBackground( | 810 void RootWindowController::CreateSystemBackground( |
| 811 bool is_first_run_after_boot) { | 811 bool is_first_run_after_boot) { |
| 812 SkColor color = SK_ColorBLACK; | 812 SkColor color = SK_ColorBLACK; |
| 813 #if defined(OS_CHROMEOS) | 813 #if defined(OS_CHROMEOS) |
| 814 if (is_first_run_after_boot) | 814 if (is_first_run_after_boot) |
| 815 color = kChromeOsBootColor; | 815 color = kChromeOsBootColor; |
| 816 #endif | 816 #endif |
| 817 system_background_.reset( | 817 system_background_.reset( |
| 818 new SystemBackgroundController(GetRootWindow(), color)); | 818 new SystemBackgroundController(GetRootWindow(), color)); |
| 819 | 819 |
| 820 #if defined(OS_CHROMEOS) | 820 #if defined(OS_CHROMEOS) |
| 821 // Make a copy of the system's boot splash screen so we can composite it | 821 // Make a copy of the system's boot splash screen so we can composite it |
| 822 // onscreen until the desktop background is ready. | 822 // onscreen until the desktop background is ready. |
| 823 if (is_first_run_after_boot && | 823 if (is_first_run_after_boot && |
| 824 (CommandLine::ForCurrentProcess()->HasSwitch( | 824 (base::CommandLine::ForCurrentProcess()->HasSwitch( |
| 825 switches::kAshCopyHostBackgroundAtBoot) || | 825 switches::kAshCopyHostBackgroundAtBoot) || |
| 826 CommandLine::ForCurrentProcess()->HasSwitch( | 826 base::CommandLine::ForCurrentProcess()->HasSwitch( |
| 827 switches::kAshAnimateFromBootSplashScreen))) | 827 switches::kAshAnimateFromBootSplashScreen))) |
| 828 boot_splash_screen_.reset(new BootSplashScreen(GetHost())); | 828 boot_splash_screen_.reset(new BootSplashScreen(GetHost())); |
| 829 #endif | 829 #endif |
| 830 } | 830 } |
| 831 | 831 |
| 832 void RootWindowController::CreateContainersInRootWindow( | 832 void RootWindowController::CreateContainersInRootWindow( |
| 833 aura::Window* root_window) { | 833 aura::Window* root_window) { |
| 834 // These containers are just used by PowerButtonController to animate groups | 834 // These containers are just used by PowerButtonController to animate groups |
| 835 // of containers simultaneously without messing up the current transformations | 835 // of containers simultaneously without messing up the current transformations |
| 836 // on those containers. These are direct children of the root window; all of | 836 // on those containers. These are direct children of the root window; all of |
| (...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 938 SetUsesScreenCoordinates(modal_container); | 938 SetUsesScreenCoordinates(modal_container); |
| 939 SetUsesEasyResizeTargeter(modal_container); | 939 SetUsesEasyResizeTargeter(modal_container); |
| 940 | 940 |
| 941 // TODO(beng): Figure out if we can make this use | 941 // TODO(beng): Figure out if we can make this use |
| 942 // SystemModalContainerEventFilter instead of stops_event_propagation. | 942 // SystemModalContainerEventFilter instead of stops_event_propagation. |
| 943 aura::Window* lock_container = CreateContainer( | 943 aura::Window* lock_container = CreateContainer( |
| 944 kShellWindowId_LockScreenContainer, | 944 kShellWindowId_LockScreenContainer, |
| 945 "LockScreenContainer", | 945 "LockScreenContainer", |
| 946 lock_screen_containers); | 946 lock_screen_containers); |
| 947 wm::SetSnapsChildrenToPhysicalPixelBoundary(lock_container); | 947 wm::SetSnapsChildrenToPhysicalPixelBoundary(lock_container); |
| 948 if (CommandLine::ForCurrentProcess()->HasSwitch( | 948 if (base::CommandLine::ForCurrentProcess()->HasSwitch( |
| 949 switches::kAshDisableLockLayoutManager)) { | 949 switches::kAshDisableLockLayoutManager)) { |
| 950 lock_container->SetLayoutManager( | 950 lock_container->SetLayoutManager( |
| 951 new WorkspaceLayoutManager(lock_container)); | 951 new WorkspaceLayoutManager(lock_container)); |
| 952 } else { | 952 } else { |
| 953 lock_container->SetLayoutManager(new LockLayoutManager(lock_container)); | 953 lock_container->SetLayoutManager(new LockLayoutManager(lock_container)); |
| 954 } | 954 } |
| 955 SetUsesScreenCoordinates(lock_container); | 955 SetUsesScreenCoordinates(lock_container); |
| 956 // TODO(beng): stopsevents | 956 // TODO(beng): stopsevents |
| 957 | 957 |
| 958 aura::Window* lock_modal_container = CreateContainer( | 958 aura::Window* lock_modal_container = CreateContainer( |
| (...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1051 else | 1051 else |
| 1052 DisableTouchHudProjection(); | 1052 DisableTouchHudProjection(); |
| 1053 } | 1053 } |
| 1054 | 1054 |
| 1055 RootWindowController* GetRootWindowController( | 1055 RootWindowController* GetRootWindowController( |
| 1056 const aura::Window* root_window) { | 1056 const aura::Window* root_window) { |
| 1057 return root_window ? GetRootWindowSettings(root_window)->controller : NULL; | 1057 return root_window ? GetRootWindowSettings(root_window)->controller : NULL; |
| 1058 } | 1058 } |
| 1059 | 1059 |
| 1060 } // namespace ash | 1060 } // namespace ash |
| OLD | NEW |