| 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 | 8 |
| 9 #include "ash/app_list/app_list.h" | 9 #include "ash/app_list/app_list.h" |
| 10 #include "ash/ash_switches.h" | 10 #include "ash/ash_switches.h" |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 84 #include "ui/views/widget/native_widget_aura.h" | 84 #include "ui/views/widget/native_widget_aura.h" |
| 85 #include "ui/views/widget/widget.h" | 85 #include "ui/views/widget/widget.h" |
| 86 | 86 |
| 87 #if !defined(OS_MACOSX) | 87 #if !defined(OS_MACOSX) |
| 88 #include "ash/accelerators/accelerator_controller.h" | 88 #include "ash/accelerators/accelerator_controller.h" |
| 89 #include "ash/accelerators/accelerator_filter.h" | 89 #include "ash/accelerators/accelerator_filter.h" |
| 90 #include "ash/accelerators/nested_dispatcher_controller.h" | 90 #include "ash/accelerators/nested_dispatcher_controller.h" |
| 91 #endif | 91 #endif |
| 92 | 92 |
| 93 #if defined(USE_X11) | 93 #if defined(USE_X11) |
| 94 #include "ui/aura/monitor_change_observer_x11.h" | 94 #include "ash/monitor/monitor_change_observer_x11.h" |
| 95 #endif | 95 #endif |
| 96 | 96 |
| 97 namespace ash { | 97 namespace ash { |
| 98 | 98 |
| 99 namespace { | 99 namespace { |
| 100 | 100 |
| 101 using aura::Window; | 101 using aura::Window; |
| 102 using views::Widget; | 102 using views::Widget; |
| 103 | 103 |
| 104 // Creates a new window for use as a container. | 104 // Creates a new window for use as a container. |
| (...skipping 362 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 467 } | 467 } |
| 468 | 468 |
| 469 internal::WorkspaceController* Shell::TestApi::workspace_controller() { | 469 internal::WorkspaceController* Shell::TestApi::workspace_controller() { |
| 470 return shell_->workspace_controller_.get(); | 470 return shell_->workspace_controller_.get(); |
| 471 } | 471 } |
| 472 | 472 |
| 473 //////////////////////////////////////////////////////////////////////////////// | 473 //////////////////////////////////////////////////////////////////////////////// |
| 474 // Shell, public: | 474 // Shell, public: |
| 475 | 475 |
| 476 Shell::Shell(ShellDelegate* delegate) | 476 Shell::Shell(ShellDelegate* delegate) |
| 477 : root_window_(aura::MonitorManager::CreateRootWindowForPrimaryMonitor()), | 477 : |
| 478 #if defined(USE_X11) |
| 479 monitor_change_observer_(new internal::MonitorChangeObserverX11), |
| 480 #endif |
| 481 root_window_(aura::MonitorManager::CreateRootWindowForPrimaryMonitor()), |
| 478 screen_(new ScreenAsh(root_window_.get())), | 482 screen_(new ScreenAsh(root_window_.get())), |
| 479 root_filter_(NULL), | 483 root_filter_(NULL), |
| 480 delegate_(delegate), | 484 delegate_(delegate), |
| 481 shelf_(NULL), | 485 shelf_(NULL), |
| 482 root_window_layout_(NULL), | 486 root_window_layout_(NULL), |
| 483 status_widget_(NULL) { | 487 status_widget_(NULL) { |
| 484 gfx::Screen::SetInstance(screen_); | 488 gfx::Screen::SetInstance(screen_); |
| 485 ui_controls::InstallUIControlsAura(CreateUIControlsAura(root_window_.get())); | 489 ui_controls::InstallUIControlsAura(CreateUIControlsAura(root_window_.get())); |
| 486 } | 490 } |
| 487 | 491 |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 537 | 541 |
| 538 DCHECK(instance_ == this); | 542 DCHECK(instance_ == this); |
| 539 instance_ = NULL; | 543 instance_ = NULL; |
| 540 } | 544 } |
| 541 | 545 |
| 542 // static | 546 // static |
| 543 Shell* Shell::CreateInstance(ShellDelegate* delegate) { | 547 Shell* Shell::CreateInstance(ShellDelegate* delegate) { |
| 544 CHECK(!instance_); | 548 CHECK(!instance_); |
| 545 aura::Env::GetInstance()->SetMonitorManager( | 549 aura::Env::GetInstance()->SetMonitorManager( |
| 546 new internal::MultiMonitorManager()); | 550 new internal::MultiMonitorManager()); |
| 547 #if defined(USE_X11) | |
| 548 aura::Env::GetInstance()->monitor_change_observer()->NotifyMonitorChange(); | |
| 549 #endif | |
| 550 instance_ = new Shell(delegate); | 551 instance_ = new Shell(delegate); |
| 551 instance_->Init(); | 552 instance_->Init(); |
| 552 return instance_; | 553 return instance_; |
| 553 } | 554 } |
| 554 | 555 |
| 555 // static | 556 // static |
| 556 Shell* Shell::GetInstance() { | 557 Shell* Shell::GetInstance() { |
| 557 DCHECK(instance_); | 558 DCHECK(instance_); |
| 558 return instance_; | 559 return instance_; |
| 559 } | 560 } |
| (...skipping 289 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 849 desktop_background_controller_->SetDesktopBackgroundImageMode( | 850 desktop_background_controller_->SetDesktopBackgroundImageMode( |
| 850 GetWallpaper(user_wallpaper_delegate_->GetUserWallpaperIndex())); | 851 GetWallpaper(user_wallpaper_delegate_->GetUserWallpaperIndex())); |
| 851 } | 852 } |
| 852 | 853 |
| 853 void Shell::DisableWorkspaceGridLayout() { | 854 void Shell::DisableWorkspaceGridLayout() { |
| 854 if (workspace_controller_.get()) | 855 if (workspace_controller_.get()) |
| 855 workspace_controller_->workspace_manager()->set_grid_size(0); | 856 workspace_controller_->workspace_manager()->set_grid_size(0); |
| 856 } | 857 } |
| 857 | 858 |
| 858 } // namespace ash | 859 } // namespace ash |
| OLD | NEW |