| 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/shell.h" | 5 #include "ash/shell.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "ash/accelerators/focus_manager_factory.h" | 10 #include "ash/accelerators/focus_manager_factory.h" |
| (...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 179 | 179 |
| 180 Shell::Shell(ShellDelegate* delegate) | 180 Shell::Shell(ShellDelegate* delegate) |
| 181 : screen_(new ScreenAsh), | 181 : screen_(new ScreenAsh), |
| 182 active_root_window_(NULL), | 182 active_root_window_(NULL), |
| 183 delegate_(delegate), | 183 delegate_(delegate), |
| 184 #if defined(OS_CHROMEOS) | 184 #if defined(OS_CHROMEOS) |
| 185 output_configurator_(new chromeos::OutputConfigurator()), | 185 output_configurator_(new chromeos::OutputConfigurator()), |
| 186 output_configurator_animation_( | 186 output_configurator_animation_( |
| 187 new internal::OutputConfiguratorAnimation()), | 187 new internal::OutputConfiguratorAnimation()), |
| 188 #endif // defined(OS_CHROMEOS) | 188 #endif // defined(OS_CHROMEOS) |
| 189 browser_context_(NULL), | 189 browser_context_(NULL) { |
| 190 simulate_modal_window_open_for_testing_(false) { | |
| 191 gfx::Screen::SetScreenInstance(gfx::SCREEN_TYPE_NATIVE, screen_.get()); | 190 gfx::Screen::SetScreenInstance(gfx::SCREEN_TYPE_NATIVE, screen_.get()); |
| 192 gfx::Screen::SetScreenInstance(gfx::SCREEN_TYPE_ALTERNATE, screen_.get()); | 191 gfx::Screen::SetScreenInstance(gfx::SCREEN_TYPE_ALTERNATE, screen_.get()); |
| 193 ui_controls::InstallUIControlsAura(internal::CreateUIControls()); | 192 ui_controls::InstallUIControlsAura(internal::CreateUIControls()); |
| 194 #if defined(OS_CHROMEOS) | 193 #if defined(OS_CHROMEOS) |
| 195 content::GpuFeatureType blacklisted_features = | 194 content::GpuFeatureType blacklisted_features = |
| 196 content::GpuDataManager::GetInstance()->GetBlacklistedFeatures(); | 195 content::GpuDataManager::GetInstance()->GetBlacklistedFeatures(); |
| 197 bool is_panel_fitting_disabled = | 196 bool is_panel_fitting_disabled = |
| 198 (blacklisted_features & content::GPU_FEATURE_TYPE_PANEL_FITTING) || | 197 (blacklisted_features & content::GPU_FEATURE_TYPE_PANEL_FITTING) || |
| 199 CommandLine::ForCurrentProcess()->HasSwitch( | 198 CommandLine::ForCurrentProcess()->HasSwitch( |
| 200 switches::kAshDisablePanelFitting); | 199 switches::kAshDisablePanelFitting); |
| (...skipping 331 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 532 | 531 |
| 533 aura::Window* Shell::GetAppListWindow() { | 532 aura::Window* Shell::GetAppListWindow() { |
| 534 return app_list_controller_.get() ? app_list_controller_->GetWindow() : NULL; | 533 return app_list_controller_.get() ? app_list_controller_->GetWindow() : NULL; |
| 535 } | 534 } |
| 536 | 535 |
| 537 bool Shell::IsScreenLocked() const { | 536 bool Shell::IsScreenLocked() const { |
| 538 return !delegate_.get() || delegate_->IsScreenLocked(); | 537 return !delegate_.get() || delegate_->IsScreenLocked(); |
| 539 } | 538 } |
| 540 | 539 |
| 541 bool Shell::IsModalWindowOpen() const { | 540 bool Shell::IsModalWindowOpen() const { |
| 542 if (simulate_modal_window_open_for_testing_) | |
| 543 return true; | |
| 544 // TODO(oshima): Walk though all root windows. | 541 // TODO(oshima): Walk though all root windows. |
| 545 const aura::Window* modal_container = GetContainer( | 542 const aura::Window* modal_container = GetContainer( |
| 546 GetPrimaryRootWindow(), | 543 GetPrimaryRootWindow(), |
| 547 internal::kShellWindowId_SystemModalContainer); | 544 internal::kShellWindowId_SystemModalContainer); |
| 548 return !modal_container->children().empty(); | 545 return !modal_container->children().empty(); |
| 549 } | 546 } |
| 550 | 547 |
| 551 views::NonClientFrameView* Shell::CreateDefaultNonClientFrameView( | 548 views::NonClientFrameView* Shell::CreateDefaultNonClientFrameView( |
| 552 views::Widget* widget) { | 549 views::Widget* widget) { |
| 553 if (CommandLine::ForCurrentProcess()->HasSwitch( | 550 if (CommandLine::ForCurrentProcess()->HasSwitch( |
| (...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 761 iter != controllers.end(); ++iter) { | 758 iter != controllers.end(); ++iter) { |
| 762 if ((*iter)->GetSystemModalLayoutManager(window)-> | 759 if ((*iter)->GetSystemModalLayoutManager(window)-> |
| 763 CanWindowReceiveEvents(window)) { | 760 CanWindowReceiveEvents(window)) { |
| 764 return true; | 761 return true; |
| 765 } | 762 } |
| 766 } | 763 } |
| 767 return false; | 764 return false; |
| 768 } | 765 } |
| 769 | 766 |
| 770 } // namespace ash | 767 } // namespace ash |
| OLD | NEW |