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 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
93 #include "ui/views/widget/widget.h" | 93 #include "ui/views/widget/widget.h" |
94 | 94 |
95 #if !defined(OS_MACOSX) | 95 #if !defined(OS_MACOSX) |
96 #include "ash/accelerators/accelerator_controller.h" | 96 #include "ash/accelerators/accelerator_controller.h" |
97 #include "ash/accelerators/accelerator_filter.h" | 97 #include "ash/accelerators/accelerator_filter.h" |
98 #include "ash/accelerators/nested_dispatcher_controller.h" | 98 #include "ash/accelerators/nested_dispatcher_controller.h" |
99 #endif | 99 #endif |
100 | 100 |
101 #if defined(OS_CHROMEOS) | 101 #if defined(OS_CHROMEOS) |
102 #include "ash/display/output_configurator_animation.h" | 102 #include "ash/display/output_configurator_animation.h" |
| 103 #include "base/chromeos/chromeos_version.h" |
103 #include "base/message_pump_aurax11.h" | 104 #include "base/message_pump_aurax11.h" |
104 #include "chromeos/display/output_configurator.h" | 105 #include "chromeos/display/output_configurator.h" |
105 #endif // defined(OS_CHROMEOS) | 106 #endif // defined(OS_CHROMEOS) |
106 | 107 |
107 namespace ash { | 108 namespace ash { |
108 | 109 |
109 namespace { | 110 namespace { |
110 | 111 |
111 using aura::Window; | 112 using aura::Window; |
112 using views::Widget; | 113 using views::Widget; |
(...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
354 void Shell::Init() { | 355 void Shell::Init() { |
355 // Install the custom factory first so that views::FocusManagers for Tray, | 356 // Install the custom factory first so that views::FocusManagers for Tray, |
356 // Launcher, and WallPaper could be created by the factory. | 357 // Launcher, and WallPaper could be created by the factory. |
357 views::FocusManagerFactory::Install(new AshFocusManagerFactory); | 358 views::FocusManagerFactory::Install(new AshFocusManagerFactory); |
358 | 359 |
359 env_filter_ = new aura::shared::CompoundEventFilter; | 360 env_filter_ = new aura::shared::CompoundEventFilter; |
360 // Pass ownership of the filter to the Env. | 361 // Pass ownership of the filter to the Env. |
361 aura::Env::GetInstance()->SetEventFilter(env_filter_); | 362 aura::Env::GetInstance()->SetEventFilter(env_filter_); |
362 | 363 |
363 cursor_manager_.set_delegate(this); | 364 cursor_manager_.set_delegate(this); |
| 365 #if defined(OS_CHROMEOS) |
| 366 if (base::chromeos::IsRunningOnChromeOS()) |
| 367 cursor_manager_.HideHostCursor(); |
| 368 #endif |
364 | 369 |
365 focus_manager_.reset(new aura::FocusManager); | 370 focus_manager_.reset(new aura::FocusManager); |
366 activation_controller_.reset( | 371 activation_controller_.reset( |
367 new internal::ActivationController(focus_manager_.get())); | 372 new internal::ActivationController(focus_manager_.get())); |
368 | 373 |
369 screen_position_controller_.reset(new internal::ScreenPositionController); | 374 screen_position_controller_.reset(new internal::ScreenPositionController); |
370 display_controller_.reset(new DisplayController); | 375 display_controller_.reset(new DisplayController); |
371 display_controller_->InitPrimaryDisplay(); | 376 display_controller_->InitPrimaryDisplay(); |
372 aura::RootWindow* root_window = display_controller_->GetPrimaryRootWindow(); | 377 aura::RootWindow* root_window = display_controller_->GetPrimaryRootWindow(); |
373 active_root_window_ = root_window; | 378 active_root_window_ = root_window; |
374 | 379 |
| 380 cursor_manager_.SetDeviceScaleFactor( |
| 381 root_window->AsRootWindowHostDelegate()->GetDeviceScaleFactor()); |
| 382 |
375 #if !defined(OS_MACOSX) | 383 #if !defined(OS_MACOSX) |
376 nested_dispatcher_controller_.reset(new NestedDispatcherController); | 384 nested_dispatcher_controller_.reset(new NestedDispatcherController); |
377 accelerator_controller_.reset(new AcceleratorController); | 385 accelerator_controller_.reset(new AcceleratorController); |
378 #endif | 386 #endif |
379 shell_context_menu_.reset(new internal::ShellContextMenu); | 387 shell_context_menu_.reset(new internal::ShellContextMenu); |
380 | 388 |
381 // The order in which event filters are added is significant. | 389 // The order in which event filters are added is significant. |
382 DCHECK(!GetEnvEventFilterCount()); | 390 DCHECK(!GetEnvEventFilterCount()); |
383 user_activity_detector_.reset(new UserActivityDetector); | 391 user_activity_detector_.reset(new UserActivityDetector); |
384 AddEnvEventFilter(user_activity_detector_.get()); | 392 AddEnvEventFilter(user_activity_detector_.get()); |
(...skipping 384 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
769 } | 777 } |
770 | 778 |
771 void Shell::ShowCursor(bool visible) { | 779 void Shell::ShowCursor(bool visible) { |
772 RootWindowList root_windows = GetAllRootWindows(); | 780 RootWindowList root_windows = GetAllRootWindows(); |
773 for (RootWindowList::iterator iter = root_windows.begin(); | 781 for (RootWindowList::iterator iter = root_windows.begin(); |
774 iter != root_windows.end(); ++iter) | 782 iter != root_windows.end(); ++iter) |
775 (*iter)->ShowCursor(visible); | 783 (*iter)->ShowCursor(visible); |
776 } | 784 } |
777 | 785 |
778 } // namespace ash | 786 } // namespace ash |
OLD | NEW |