Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(471)

Side by Side Diff: ash/shell.cc

Issue 10919135: Move ash specific cursor code to CursorManager. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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
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 309 matching lines...) Expand 10 before | Expand all | Expand 10 after
694 aura::client::SetCursorClient(root_window, &cursor_manager_); 702 aura::client::SetCursorClient(root_window, &cursor_manager_);
695 aura::client::SetTooltipClient(root_window, tooltip_controller_.get()); 703 aura::client::SetTooltipClient(root_window, tooltip_controller_.get());
696 704
697 if (nested_dispatcher_controller_.get()) { 705 if (nested_dispatcher_controller_.get()) {
698 aura::client::SetDispatcherClient(root_window, 706 aura::client::SetDispatcherClient(root_window,
699 nested_dispatcher_controller_.get()); 707 nested_dispatcher_controller_.get());
700 } 708 }
701 if (user_action_client_.get()) 709 if (user_action_client_.get())
702 aura::client::SetUserActionClient(root_window, user_action_client_.get()); 710 aura::client::SetUserActionClient(root_window, user_action_client_.get());
703 711
704 root_window->SetCursor(ui::kCursorPointer);
Daniel Erat 2012/09/06 23:47:15 Why's it okay to remove this? CursorManager looks
mazda 2012/09/07 02:20:57 I restored the line. CompoundEventFilter sets the
705 controller->InitLayoutManagers(); 712 controller->InitLayoutManagers();
706 713
707 // TODO(oshima): Move the instance to RootWindowController when 714 // TODO(oshima): Move the instance to RootWindowController when
708 // the extended desktop is enabled by default. 715 // the extended desktop is enabled by default.
709 internal::AlwaysOnTopController* always_on_top_controller = 716 internal::AlwaysOnTopController* always_on_top_controller =
710 new internal::AlwaysOnTopController; 717 new internal::AlwaysOnTopController;
711 always_on_top_controller->SetContainers( 718 always_on_top_controller->SetContainers(
712 root_window->GetChildById(internal::kShellWindowId_DefaultContainer), 719 root_window->GetChildById(internal::kShellWindowId_DefaultContainer),
713 root_window->GetChildById(internal::kShellWindowId_AlwaysOnTopContainer)); 720 root_window->GetChildById(internal::kShellWindowId_AlwaysOnTopContainer));
714 root_window->SetProperty(internal::kAlwaysOnTopControllerKey, 721 root_window->SetProperty(internal::kAlwaysOnTopControllerKey,
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
769 } 776 }
770 777
771 void Shell::ShowCursor(bool visible) { 778 void Shell::ShowCursor(bool visible) {
772 RootWindowList root_windows = GetAllRootWindows(); 779 RootWindowList root_windows = GetAllRootWindows();
773 for (RootWindowList::iterator iter = root_windows.begin(); 780 for (RootWindowList::iterator iter = root_windows.begin();
774 iter != root_windows.end(); ++iter) 781 iter != root_windows.end(); ++iter)
775 (*iter)->ShowCursor(visible); 782 (*iter)->ShowCursor(visible);
776 } 783 }
777 784
778 } // namespace ash 785 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698