| 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 273 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 284 } | 284 } |
| 285 | 285 |
| 286 void Shell::Init() { | 286 void Shell::Init() { |
| 287 DCHECK(!GetRootWindowEventFilterCount()); | 287 DCHECK(!GetRootWindowEventFilterCount()); |
| 288 | 288 |
| 289 // PartialScreenshotEventFilter must be the first one to capture key | 289 // PartialScreenshotEventFilter must be the first one to capture key |
| 290 // events when the taking partial screenshot UI is there. | 290 // events when the taking partial screenshot UI is there. |
| 291 partial_screenshot_filter_.reset(new internal::PartialScreenshotEventFilter); | 291 partial_screenshot_filter_.reset(new internal::PartialScreenshotEventFilter); |
| 292 AddRootWindowEventFilter(partial_screenshot_filter_.get()); | 292 AddRootWindowEventFilter(partial_screenshot_filter_.get()); |
| 293 | 293 |
| 294 // InputMethodEventFilter must be added next to PartialScreenshot | 294 // Then AcceleratorFilter and InputMethodEventFilter must be added (in this |
| 295 // since it has the higher priority. | 295 // order) since they have the second highest priority. |
| 296 DCHECK_EQ(1U, GetRootWindowEventFilterCount()); |
| 297 #if !defined(OS_MACOSX) |
| 298 accelerator_filter_.reset(new internal::AcceleratorFilter); |
| 299 AddRootWindowEventFilter(accelerator_filter_.get()); |
| 300 DCHECK_EQ(2U, GetRootWindowEventFilterCount()); |
| 301 #endif |
| 296 input_method_filter_.reset(new internal::InputMethodEventFilter); | 302 input_method_filter_.reset(new internal::InputMethodEventFilter); |
| 297 AddRootWindowEventFilter(input_method_filter_.get()); | 303 AddRootWindowEventFilter(input_method_filter_.get()); |
| 298 | 304 |
| 299 // Dynamic window mode affects window mode computation. | 305 // Dynamic window mode affects window mode computation. |
| 300 CommandLine* command_line = CommandLine::ForCurrentProcess(); | 306 CommandLine* command_line = CommandLine::ForCurrentProcess(); |
| 301 dynamic_window_mode_ = command_line->HasSwitch( | 307 dynamic_window_mode_ = command_line->HasSwitch( |
| 302 switches::kAuraDynamicWindowMode); | 308 switches::kAuraDynamicWindowMode); |
| 303 | 309 |
| 304 // Window mode must be set before computing containers or layout managers. | 310 // Window mode must be set before computing containers or layout managers. |
| 305 gfx::Size monitor_size = gfx::Screen::GetPrimaryMonitorSize(); | 311 gfx::Size monitor_size = gfx::Screen::GetPrimaryMonitorSize(); |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 348 | 354 |
| 349 // Force a layout. | 355 // Force a layout. |
| 350 root_window->layout_manager()->OnWindowResized(); | 356 root_window->layout_manager()->OnWindowResized(); |
| 351 | 357 |
| 352 window_modality_controller_.reset(new internal::WindowModalityController); | 358 window_modality_controller_.reset(new internal::WindowModalityController); |
| 353 AddRootWindowEventFilter(window_modality_controller_.get()); | 359 AddRootWindowEventFilter(window_modality_controller_.get()); |
| 354 | 360 |
| 355 visibility_controller_.reset(new internal::VisibilityController); | 361 visibility_controller_.reset(new internal::VisibilityController); |
| 356 aura::client::SetVisibilityClient(visibility_controller_.get()); | 362 aura::client::SetVisibilityClient(visibility_controller_.get()); |
| 357 | 363 |
| 358 #if !defined(OS_MACOSX) | |
| 359 accelerator_filter_.reset(new internal::AcceleratorFilter); | |
| 360 AddRootWindowEventFilter(accelerator_filter_.get()); | |
| 361 #endif | |
| 362 | |
| 363 tooltip_controller_.reset(new internal::TooltipController); | 364 tooltip_controller_.reset(new internal::TooltipController); |
| 364 AddRootWindowEventFilter(tooltip_controller_.get()); | 365 AddRootWindowEventFilter(tooltip_controller_.get()); |
| 365 aura::client::SetTooltipClient(tooltip_controller_.get()); | 366 aura::client::SetTooltipClient(tooltip_controller_.get()); |
| 366 | 367 |
| 367 drag_drop_controller_.reset(new internal::DragDropController); | 368 drag_drop_controller_.reset(new internal::DragDropController); |
| 368 power_button_controller_.reset(new PowerButtonController); | 369 power_button_controller_.reset(new PowerButtonController); |
| 369 video_detector_.reset(new VideoDetector); | 370 video_detector_.reset(new VideoDetector); |
| 370 window_cycle_controller_.reset(new WindowCycleController); | 371 window_cycle_controller_.reset(new WindowCycleController); |
| 371 } | 372 } |
| 372 | 373 |
| (...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 597 // Create the desktop background image. | 598 // Create the desktop background image. |
| 598 root_window_layout_->SetBackgroundWidget(internal::CreateDesktopBackground()); | 599 root_window_layout_->SetBackgroundWidget(internal::CreateDesktopBackground()); |
| 599 root_window_layout_->SetBackgroundLayer(NULL); | 600 root_window_layout_->SetBackgroundLayer(NULL); |
| 600 } | 601 } |
| 601 | 602 |
| 602 void Shell::ResetLayoutManager(int container_id) { | 603 void Shell::ResetLayoutManager(int container_id) { |
| 603 GetContainer(container_id)->SetLayoutManager(NULL); | 604 GetContainer(container_id)->SetLayoutManager(NULL); |
| 604 } | 605 } |
| 605 | 606 |
| 606 } // namespace ash | 607 } // namespace ash |
| OLD | NEW |