| 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 230 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 241 // Shell, public: | 241 // Shell, public: |
| 242 | 242 |
| 243 Shell::Shell(ShellDelegate* delegate) | 243 Shell::Shell(ShellDelegate* delegate) |
| 244 : root_filter_(new internal::RootWindowEventFilter), | 244 : root_filter_(new internal::RootWindowEventFilter), |
| 245 #if !defined(OS_MACOSX) | 245 #if !defined(OS_MACOSX) |
| 246 nested_dispatcher_controller_(new NestedDispatcherController), | 246 nested_dispatcher_controller_(new NestedDispatcherController), |
| 247 accelerator_controller_(new AcceleratorController), | 247 accelerator_controller_(new AcceleratorController), |
| 248 #endif | 248 #endif |
| 249 delegate_(delegate), | 249 delegate_(delegate), |
| 250 shelf_(NULL), | 250 shelf_(NULL), |
| 251 window_mode_(MODE_OVERLAPPING), | 251 window_mode_(MODE_MANAGED), |
| 252 desktop_background_mode_(BACKGROUND_IMAGE), | 252 desktop_background_mode_(BACKGROUND_IMAGE), |
| 253 root_window_layout_(NULL), | 253 root_window_layout_(NULL), |
| 254 status_widget_(NULL) { | 254 status_widget_(NULL) { |
| 255 // Pass ownership of the filter to the root window. | 255 // Pass ownership of the filter to the root window. |
| 256 GetRootWindow()->SetEventFilter(root_filter_); | 256 GetRootWindow()->SetEventFilter(root_filter_); |
| 257 } | 257 } |
| 258 | 258 |
| 259 Shell::~Shell() { | 259 Shell::~Shell() { |
| 260 RemoveRootWindowEventFilter(partial_screenshot_filter_.get()); | 260 RemoveRootWindowEventFilter(partial_screenshot_filter_.get()); |
| 261 RemoveRootWindowEventFilter(input_method_filter_.get()); | 261 RemoveRootWindowEventFilter(input_method_filter_.get()); |
| (...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 438 std::string mode = | 438 std::string mode = |
| 439 command_line->GetSwitchValueASCII(switches::kAuraWindowMode); | 439 command_line->GetSwitchValueASCII(switches::kAuraWindowMode); |
| 440 if (mode == switches::kAuraWindowModeCompact) | 440 if (mode == switches::kAuraWindowModeCompact) |
| 441 return MODE_COMPACT; | 441 return MODE_COMPACT; |
| 442 if (mode == switches::kAuraWindowModeManaged) | 442 if (mode == switches::kAuraWindowModeManaged) |
| 443 return MODE_MANAGED; | 443 return MODE_MANAGED; |
| 444 if (mode == switches::kAuraWindowModeOverlapping) | 444 if (mode == switches::kAuraWindowModeOverlapping) |
| 445 return MODE_OVERLAPPING; | 445 return MODE_OVERLAPPING; |
| 446 } | 446 } |
| 447 | 447 |
| 448 // Overlapping is the default. | 448 // Managed is the default. |
| 449 return Shell::MODE_OVERLAPPING; | 449 return Shell::MODE_MANAGED; |
| 450 } | 450 } |
| 451 | 451 |
| 452 aura::Window* Shell::GetContainer(int container_id) { | 452 aura::Window* Shell::GetContainer(int container_id) { |
| 453 return const_cast<aura::Window*>( | 453 return const_cast<aura::Window*>( |
| 454 const_cast<const Shell*>(this)->GetContainer(container_id)); | 454 const_cast<const Shell*>(this)->GetContainer(container_id)); |
| 455 } | 455 } |
| 456 | 456 |
| 457 const aura::Window* Shell::GetContainer(int container_id) const { | 457 const aura::Window* Shell::GetContainer(int container_id) const { |
| 458 return GetRootWindow()->GetChildById(container_id); | 458 return GetRootWindow()->GetChildById(container_id); |
| 459 } | 459 } |
| (...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 615 | 615 |
| 616 // Create the desktop background image. | 616 // Create the desktop background image. |
| 617 SetDesktopBackgroundMode(BACKGROUND_IMAGE); | 617 SetDesktopBackgroundMode(BACKGROUND_IMAGE); |
| 618 } | 618 } |
| 619 | 619 |
| 620 void Shell::ResetLayoutManager(int container_id) { | 620 void Shell::ResetLayoutManager(int container_id) { |
| 621 GetContainer(container_id)->SetLayoutManager(NULL); | 621 GetContainer(container_id)->SetLayoutManager(NULL); |
| 622 } | 622 } |
| 623 | 623 |
| 624 } // namespace ash | 624 } // namespace ash |
| OLD | NEW |