| 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 #include <utility> |     9 #include <utility> | 
|    10  |    10  | 
| (...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|   235 // static |   235 // static | 
|   236 aura::Window* Shell::GetTargetRootWindow() { |   236 aura::Window* Shell::GetTargetRootWindow() { | 
|   237   CHECK(HasInstance()); |   237   CHECK(HasInstance()); | 
|   238   Shell* shell = GetInstance(); |   238   Shell* shell = GetInstance(); | 
|   239   if (shell->scoped_target_root_window_) |   239   if (shell->scoped_target_root_window_) | 
|   240     return shell->scoped_target_root_window_; |   240     return shell->scoped_target_root_window_; | 
|   241   return shell->target_root_window_; |   241   return shell->target_root_window_; | 
|   242 } |   242 } | 
|   243  |   243  | 
|   244 // static |   244 // static | 
|   245 gfx::Screen* Shell::GetScreen() { |  | 
|   246   return gfx::Screen::GetScreen(); |  | 
|   247 } |  | 
|   248  |  | 
|   249 // static |  | 
|   250 aura::Window::Windows Shell::GetAllRootWindows() { |   245 aura::Window::Windows Shell::GetAllRootWindows() { | 
|   251   CHECK(HasInstance()); |   246   CHECK(HasInstance()); | 
|   252   return Shell::GetInstance()->window_tree_host_manager()->GetAllRootWindows(); |   247   return Shell::GetInstance()->window_tree_host_manager()->GetAllRootWindows(); | 
|   253 } |   248 } | 
|   254  |   249  | 
|   255 // static |   250 // static | 
|   256 aura::Window* Shell::GetContainer(aura::Window* root_window, |   251 aura::Window* Shell::GetContainer(aura::Window* root_window, | 
|   257                                   int container_id) { |   252                                   int container_id) { | 
|   258   return root_window->GetChildById(container_id); |   253   return root_window->GetChildById(container_id); | 
|   259 } |   254 } | 
| (...skipping 643 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|   903   window_tree_host_manager_->CreatePrimaryHost( |   898   window_tree_host_manager_->CreatePrimaryHost( | 
|   904       ShellInitParamsToAshWindowTreeHostInitParams(init_params)); |   899       ShellInitParamsToAshWindowTreeHostInitParams(init_params)); | 
|   905   aura::Window* root_window = window_tree_host_manager_->GetPrimaryRootWindow(); |   900   aura::Window* root_window = window_tree_host_manager_->GetPrimaryRootWindow(); | 
|   906   target_root_window_ = root_window; |   901   target_root_window_ = root_window; | 
|   907  |   902  | 
|   908 #if defined(OS_CHROMEOS) |   903 #if defined(OS_CHROMEOS) | 
|   909   resolution_notification_controller_.reset( |   904   resolution_notification_controller_.reset( | 
|   910       new ResolutionNotificationController); |   905       new ResolutionNotificationController); | 
|   911 #endif |   906 #endif | 
|   912  |   907  | 
|   913   cursor_manager_.SetDisplay(GetScreen()->GetPrimaryDisplay()); |   908   cursor_manager_.SetDisplay(gfx::Screen::GetScreen()->GetPrimaryDisplay()); | 
|   914  |   909  | 
|   915   nested_accelerator_controller_.reset( |   910   nested_accelerator_controller_.reset( | 
|   916       new ::wm::NestedAcceleratorController(new NestedAcceleratorDelegate)); |   911       new ::wm::NestedAcceleratorController(new NestedAcceleratorDelegate)); | 
|   917   accelerator_controller_.reset(new AcceleratorController); |   912   accelerator_controller_.reset(new AcceleratorController); | 
|   918   maximize_mode_controller_.reset(new MaximizeModeController()); |   913   maximize_mode_controller_.reset(new MaximizeModeController()); | 
|   919  |   914  | 
|   920   AddPreTargetHandler(window_tree_host_manager_->input_method_event_handler()); |   915   AddPreTargetHandler(window_tree_host_manager_->input_method_event_handler()); | 
|   921  |   916  | 
|   922 #if defined(OS_CHROMEOS) |   917 #if defined(OS_CHROMEOS) | 
|   923   magnifier_key_scroll_handler_ = MagnifierKeyScroller::CreateHandler(); |   918   magnifier_key_scroll_handler_ = MagnifierKeyScroller::CreateHandler(); | 
| (...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|  1170  |  1165  | 
|  1171 void Shell::OnWindowActivated( |  1166 void Shell::OnWindowActivated( | 
|  1172     aura::client::ActivationChangeObserver::ActivationReason reason, |  1167     aura::client::ActivationChangeObserver::ActivationReason reason, | 
|  1173     aura::Window* gained_active, |  1168     aura::Window* gained_active, | 
|  1174     aura::Window* lost_active) { |  1169     aura::Window* lost_active) { | 
|  1175   if (gained_active) |  1170   if (gained_active) | 
|  1176     target_root_window_ = gained_active->GetRootWindow(); |  1171     target_root_window_ = gained_active->GetRootWindow(); | 
|  1177 } |  1172 } | 
|  1178  |  1173  | 
|  1179 }  // namespace ash |  1174 }  // namespace ash | 
| OLD | NEW |