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 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
177 | 177 |
178 Shell::Shell(ShellDelegate* delegate) | 178 Shell::Shell(ShellDelegate* delegate) |
179 : screen_(new ScreenAsh), | 179 : screen_(new ScreenAsh), |
180 active_root_window_(NULL), | 180 active_root_window_(NULL), |
181 delegate_(delegate), | 181 delegate_(delegate), |
182 #if defined(OS_CHROMEOS) | 182 #if defined(OS_CHROMEOS) |
183 output_configurator_(new chromeos::OutputConfigurator()), | 183 output_configurator_(new chromeos::OutputConfigurator()), |
184 output_configurator_animation_( | 184 output_configurator_animation_( |
185 new internal::OutputConfiguratorAnimation()), | 185 new internal::OutputConfiguratorAnimation()), |
186 #endif // defined(OS_CHROMEOS) | 186 #endif // defined(OS_CHROMEOS) |
187 browser_context_(NULL) { | 187 browser_context_(NULL), |
188 simulate_modal_window_open_for_testing_(false) { | |
188 gfx::Screen::SetScreenInstance(gfx::SCREEN_TYPE_NATIVE, screen_.get()); | 189 gfx::Screen::SetScreenInstance(gfx::SCREEN_TYPE_NATIVE, screen_.get()); |
189 gfx::Screen::SetScreenInstance(gfx::SCREEN_TYPE_ALTERNATE, screen_.get()); | 190 gfx::Screen::SetScreenInstance(gfx::SCREEN_TYPE_ALTERNATE, screen_.get()); |
190 ui_controls::InstallUIControlsAura(internal::CreateUIControls()); | 191 ui_controls::InstallUIControlsAura(internal::CreateUIControls()); |
191 #if defined(OS_CHROMEOS) | 192 #if defined(OS_CHROMEOS) |
192 output_configurator_->AddObserver(output_configurator_animation_.get()); | 193 output_configurator_->AddObserver(output_configurator_animation_.get()); |
193 base::MessagePumpAuraX11::Current()->AddDispatcherForRootWindow( | 194 base::MessagePumpAuraX11::Current()->AddDispatcherForRootWindow( |
194 output_configurator()); | 195 output_configurator()); |
195 #endif // defined(OS_CHROMEOS) | 196 #endif // defined(OS_CHROMEOS) |
196 } | 197 } |
197 | 198 |
(...skipping 323 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
521 | 522 |
522 aura::Window* Shell::GetAppListWindow() { | 523 aura::Window* Shell::GetAppListWindow() { |
523 return app_list_controller_.get() ? app_list_controller_->GetWindow() : NULL; | 524 return app_list_controller_.get() ? app_list_controller_->GetWindow() : NULL; |
524 } | 525 } |
525 | 526 |
526 bool Shell::IsScreenLocked() const { | 527 bool Shell::IsScreenLocked() const { |
527 return !delegate_.get() || delegate_->IsScreenLocked(); | 528 return !delegate_.get() || delegate_->IsScreenLocked(); |
528 } | 529 } |
529 | 530 |
530 bool Shell::IsModalWindowOpen() const { | 531 bool Shell::IsModalWindowOpen() const { |
532 if (simulate_modal_window_open_for_testing_) return true; | |
Daniel Erat
2012/10/16 03:03:50
move "return true" to the next line, indented two
sschmitz
2012/10/16 18:18:23
Done.
| |
531 // TODO(oshima): Walk though all root windows. | 533 // TODO(oshima): Walk though all root windows. |
532 const aura::Window* modal_container = GetContainer( | 534 const aura::Window* modal_container = GetContainer( |
533 GetPrimaryRootWindow(), | 535 GetPrimaryRootWindow(), |
534 internal::kShellWindowId_SystemModalContainer); | 536 internal::kShellWindowId_SystemModalContainer); |
535 return !modal_container->children().empty(); | 537 return !modal_container->children().empty(); |
536 } | 538 } |
537 | 539 |
538 views::NonClientFrameView* Shell::CreateDefaultNonClientFrameView( | 540 views::NonClientFrameView* Shell::CreateDefaultNonClientFrameView( |
539 views::Widget* widget) { | 541 views::Widget* widget) { |
540 if (CommandLine::ForCurrentProcess()->HasSwitch( | 542 if (CommandLine::ForCurrentProcess()->HasSwitch( |
(...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
748 iter != controllers.end(); ++iter) { | 750 iter != controllers.end(); ++iter) { |
749 if ((*iter)->GetSystemModalLayoutManager(window)-> | 751 if ((*iter)->GetSystemModalLayoutManager(window)-> |
750 CanWindowReceiveEvents(window)) { | 752 CanWindowReceiveEvents(window)) { |
751 return true; | 753 return true; |
752 } | 754 } |
753 } | 755 } |
754 return false; | 756 return false; |
755 } | 757 } |
756 | 758 |
757 } // namespace ash | 759 } // namespace ash |
OLD | NEW |