| 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 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 65 #include "base/bind.h" | 65 #include "base/bind.h" |
| 66 #include "base/command_line.h" | 66 #include "base/command_line.h" |
| 67 #include "base/debug/leak_annotations.h" | 67 #include "base/debug/leak_annotations.h" |
| 68 #include "ui/aura/client/aura_constants.h" | 68 #include "ui/aura/client/aura_constants.h" |
| 69 #include "ui/aura/client/user_action_client.h" | 69 #include "ui/aura/client/user_action_client.h" |
| 70 #include "ui/aura/display_manager.h" | 70 #include "ui/aura/display_manager.h" |
| 71 #include "ui/aura/env.h" | 71 #include "ui/aura/env.h" |
| 72 #include "ui/aura/focus_manager.h" | 72 #include "ui/aura/focus_manager.h" |
| 73 #include "ui/aura/layout_manager.h" | 73 #include "ui/aura/layout_manager.h" |
| 74 #include "ui/aura/root_window.h" | 74 #include "ui/aura/root_window.h" |
| 75 #include "ui/aura/shared/compound_event_filter.h" | |
| 76 #include "ui/aura/shared/input_method_event_filter.h" | |
| 77 #include "ui/aura/ui_controls_aura.h" | 75 #include "ui/aura/ui_controls_aura.h" |
| 78 #include "ui/aura/window.h" | 76 #include "ui/aura/window.h" |
| 79 #include "ui/compositor/layer.h" | 77 #include "ui/compositor/layer.h" |
| 80 #include "ui/compositor/layer_animator.h" | 78 #include "ui/compositor/layer_animator.h" |
| 81 #include "ui/gfx/display.h" | 79 #include "ui/gfx/display.h" |
| 82 #include "ui/gfx/image/image_skia.h" | 80 #include "ui/gfx/image/image_skia.h" |
| 83 #include "ui/gfx/screen.h" | 81 #include "ui/gfx/screen.h" |
| 84 #include "ui/gfx/size.h" | 82 #include "ui/gfx/size.h" |
| 85 #include "ui/ui_controls/ui_controls.h" | 83 #include "ui/ui_controls/ui_controls.h" |
| 84 #include "ui/views/corewm/compound_event_filter.h" |
| 85 #include "ui/views/corewm/input_method_event_filter.h" |
| 86 #include "ui/views/focus/focus_manager_factory.h" | 86 #include "ui/views/focus/focus_manager_factory.h" |
| 87 #include "ui/views/widget/native_widget_aura.h" | 87 #include "ui/views/widget/native_widget_aura.h" |
| 88 #include "ui/views/widget/widget.h" | 88 #include "ui/views/widget/widget.h" |
| 89 | 89 |
| 90 #if !defined(OS_MACOSX) | 90 #if !defined(OS_MACOSX) |
| 91 #include "ash/accelerators/accelerator_controller.h" | 91 #include "ash/accelerators/accelerator_controller.h" |
| 92 #include "ash/accelerators/accelerator_filter.h" | 92 #include "ash/accelerators/accelerator_filter.h" |
| 93 #include "ash/accelerators/nested_dispatcher_controller.h" | 93 #include "ash/accelerators/nested_dispatcher_controller.h" |
| 94 #endif | 94 #endif |
| 95 | 95 |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 158 | 158 |
| 159 //////////////////////////////////////////////////////////////////////////////// | 159 //////////////////////////////////////////////////////////////////////////////// |
| 160 // Shell::TestApi | 160 // Shell::TestApi |
| 161 | 161 |
| 162 Shell::TestApi::TestApi(Shell* shell) : shell_(shell) {} | 162 Shell::TestApi::TestApi(Shell* shell) : shell_(shell) {} |
| 163 | 163 |
| 164 internal::RootWindowLayoutManager* Shell::TestApi::root_window_layout() { | 164 internal::RootWindowLayoutManager* Shell::TestApi::root_window_layout() { |
| 165 return shell_->GetPrimaryRootWindowController()->root_window_layout(); | 165 return shell_->GetPrimaryRootWindowController()->root_window_layout(); |
| 166 } | 166 } |
| 167 | 167 |
| 168 aura::shared::InputMethodEventFilter* | 168 views::corewm::InputMethodEventFilter* |
| 169 Shell::TestApi::input_method_event_filter() { | 169 Shell::TestApi::input_method_event_filter() { |
| 170 return shell_->input_method_filter_.get(); | 170 return shell_->input_method_filter_.get(); |
| 171 } | 171 } |
| 172 | 172 |
| 173 internal::SystemGestureEventFilter* | 173 internal::SystemGestureEventFilter* |
| 174 Shell::TestApi::system_gesture_event_filter() { | 174 Shell::TestApi::system_gesture_event_filter() { |
| 175 return shell_->system_gesture_filter_.get(); | 175 return shell_->system_gesture_filter_.get(); |
| 176 } | 176 } |
| 177 | 177 |
| 178 internal::WorkspaceController* Shell::TestApi::workspace_controller() { | 178 internal::WorkspaceController* Shell::TestApi::workspace_controller() { |
| (...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 381 bool Shell::IsLauncherPerDisplayEnabled() { | 381 bool Shell::IsLauncherPerDisplayEnabled() { |
| 382 CommandLine* command_line = CommandLine::ForCurrentProcess(); | 382 CommandLine* command_line = CommandLine::ForCurrentProcess(); |
| 383 return command_line->HasSwitch(switches::kAshLauncherPerDisplay); | 383 return command_line->HasSwitch(switches::kAshLauncherPerDisplay); |
| 384 } | 384 } |
| 385 | 385 |
| 386 void Shell::Init() { | 386 void Shell::Init() { |
| 387 // Install the custom factory first so that views::FocusManagers for Tray, | 387 // Install the custom factory first so that views::FocusManagers for Tray, |
| 388 // Launcher, and WallPaper could be created by the factory. | 388 // Launcher, and WallPaper could be created by the factory. |
| 389 views::FocusManagerFactory::Install(new AshFocusManagerFactory); | 389 views::FocusManagerFactory::Install(new AshFocusManagerFactory); |
| 390 | 390 |
| 391 env_filter_.reset(new aura::shared::CompoundEventFilter); | 391 env_filter_.reset(new views::corewm::CompoundEventFilter); |
| 392 AddEnvEventFilter(env_filter_.get()); | 392 AddEnvEventFilter(env_filter_.get()); |
| 393 | 393 |
| 394 focus_manager_.reset(new aura::FocusManager); | 394 focus_manager_.reset(new aura::FocusManager); |
| 395 activation_controller_.reset( | 395 activation_controller_.reset( |
| 396 new internal::ActivationController(focus_manager_.get())); | 396 new internal::ActivationController(focus_manager_.get())); |
| 397 | 397 |
| 398 focus_cycler_.reset(new internal::FocusCycler()); | 398 focus_cycler_.reset(new internal::FocusCycler()); |
| 399 | 399 |
| 400 screen_position_controller_.reset(new internal::ScreenPositionController); | 400 screen_position_controller_.reset(new internal::ScreenPositionController); |
| 401 display_controller_.reset(new DisplayController); | 401 display_controller_.reset(new DisplayController); |
| (...skipping 13 matching lines...) Expand all Loading... |
| 415 user_activity_detector_.reset(new UserActivityDetector); | 415 user_activity_detector_.reset(new UserActivityDetector); |
| 416 AddEnvEventFilter(user_activity_detector_.get()); | 416 AddEnvEventFilter(user_activity_detector_.get()); |
| 417 | 417 |
| 418 event_rewriter_filter_.reset(new internal::EventRewriterEventFilter); | 418 event_rewriter_filter_.reset(new internal::EventRewriterEventFilter); |
| 419 AddEnvEventFilter(event_rewriter_filter_.get()); | 419 AddEnvEventFilter(event_rewriter_filter_.get()); |
| 420 | 420 |
| 421 overlay_filter_.reset(new internal::OverlayEventFilter); | 421 overlay_filter_.reset(new internal::OverlayEventFilter); |
| 422 AddEnvEventFilter(overlay_filter_.get()); | 422 AddEnvEventFilter(overlay_filter_.get()); |
| 423 AddShellObserver(overlay_filter_.get()); | 423 AddShellObserver(overlay_filter_.get()); |
| 424 | 424 |
| 425 input_method_filter_.reset(new aura::shared::InputMethodEventFilter()); | 425 input_method_filter_.reset(new views::corewm::InputMethodEventFilter); |
| 426 AddEnvEventFilter(input_method_filter_.get()); | 426 AddEnvEventFilter(input_method_filter_.get()); |
| 427 | 427 |
| 428 #if !defined(OS_MACOSX) | 428 #if !defined(OS_MACOSX) |
| 429 accelerator_filter_.reset(new internal::AcceleratorFilter); | 429 accelerator_filter_.reset(new internal::AcceleratorFilter); |
| 430 AddEnvEventFilter(accelerator_filter_.get()); | 430 AddEnvEventFilter(accelerator_filter_.get()); |
| 431 #endif | 431 #endif |
| 432 | 432 |
| 433 system_gesture_filter_.reset(new internal::SystemGestureEventFilter); | 433 system_gesture_filter_.reset(new internal::SystemGestureEventFilter); |
| 434 AddEnvEventFilter(system_gesture_filter_.get()); | 434 AddEnvEventFilter(system_gesture_filter_.get()); |
| 435 | 435 |
| (...skipping 399 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 835 | 835 |
| 836 bool Shell::CanAcceptEvents() { | 836 bool Shell::CanAcceptEvents() { |
| 837 return true; | 837 return true; |
| 838 } | 838 } |
| 839 | 839 |
| 840 ui::EventTarget* Shell::GetParentTarget() { | 840 ui::EventTarget* Shell::GetParentTarget() { |
| 841 return NULL; | 841 return NULL; |
| 842 } | 842 } |
| 843 | 843 |
| 844 } // namespace ash | 844 } // namespace ash |
| OLD | NEW |