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

Side by Side Diff: ash/shell.cc

Issue 9513004: Switch default WM mode to managed (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix comments Created 8 years, 9 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
« no previous file with comments | « ash/shell.h ('k') | ash/shell_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 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 261 matching lines...) Expand 10 before | Expand all | Expand 10 after
272 Shell::Shell(ShellDelegate* delegate) 272 Shell::Shell(ShellDelegate* delegate)
273 : root_filter_(new internal::RootWindowEventFilter), 273 : root_filter_(new internal::RootWindowEventFilter),
274 #if !defined(OS_MACOSX) 274 #if !defined(OS_MACOSX)
275 nested_dispatcher_controller_(new NestedDispatcherController), 275 nested_dispatcher_controller_(new NestedDispatcherController),
276 accelerator_controller_(new AcceleratorController), 276 accelerator_controller_(new AcceleratorController),
277 #endif 277 #endif
278 delegate_(delegate), 278 delegate_(delegate),
279 audio_controller_(NULL), 279 audio_controller_(NULL),
280 brightness_controller_(NULL), 280 brightness_controller_(NULL),
281 shelf_(NULL), 281 shelf_(NULL),
282 window_mode_(MODE_OVERLAPPING), 282 window_mode_(MODE_MANAGED),
283 desktop_background_mode_(BACKGROUND_IMAGE), 283 desktop_background_mode_(BACKGROUND_IMAGE),
284 root_window_layout_(NULL), 284 root_window_layout_(NULL),
285 status_widget_(NULL) { 285 status_widget_(NULL) {
286 // Pass ownership of the filter to the root window. 286 // Pass ownership of the filter to the root window.
287 GetRootWindow()->SetEventFilter(root_filter_); 287 GetRootWindow()->SetEventFilter(root_filter_);
288 } 288 }
289 289
290 Shell::~Shell() { 290 Shell::~Shell() {
291 RemoveRootWindowEventFilter(partial_screenshot_filter_.get()); 291 RemoveRootWindowEventFilter(partial_screenshot_filter_.get());
292 RemoveRootWindowEventFilter(input_method_filter_.get()); 292 RemoveRootWindowEventFilter(input_method_filter_.get());
(...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after
478 std::string mode = 478 std::string mode =
479 command_line->GetSwitchValueASCII(switches::kAuraWindowMode); 479 command_line->GetSwitchValueASCII(switches::kAuraWindowMode);
480 if (mode == switches::kAuraWindowModeCompact) 480 if (mode == switches::kAuraWindowModeCompact)
481 return MODE_COMPACT; 481 return MODE_COMPACT;
482 if (mode == switches::kAuraWindowModeManaged) 482 if (mode == switches::kAuraWindowModeManaged)
483 return MODE_MANAGED; 483 return MODE_MANAGED;
484 if (mode == switches::kAuraWindowModeOverlapping) 484 if (mode == switches::kAuraWindowModeOverlapping)
485 return MODE_OVERLAPPING; 485 return MODE_OVERLAPPING;
486 } 486 }
487 487
488 // Overlapping is the default. 488 // Managed is the default.
489 return Shell::MODE_OVERLAPPING; 489 return Shell::MODE_MANAGED;
490 } 490 }
491 491
492 aura::Window* Shell::GetContainer(int container_id) { 492 aura::Window* Shell::GetContainer(int container_id) {
493 return const_cast<aura::Window*>( 493 return const_cast<aura::Window*>(
494 const_cast<const Shell*>(this)->GetContainer(container_id)); 494 const_cast<const Shell*>(this)->GetContainer(container_id));
495 } 495 }
496 496
497 const aura::Window* Shell::GetContainer(int container_id) const { 497 const aura::Window* Shell::GetContainer(int container_id) const {
498 return GetRootWindow()->GetChildById(container_id); 498 return GetRootWindow()->GetChildById(container_id);
499 } 499 }
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after
654 launcher_->widget()->Show(); 654 launcher_->widget()->Show();
655 655
656 // Create the desktop background image. 656 // Create the desktop background image.
657 SetDesktopBackgroundMode(BACKGROUND_IMAGE); 657 SetDesktopBackgroundMode(BACKGROUND_IMAGE);
658 } 658 }
659 659
660 void Shell::ResetLayoutManager(int container_id) { 660 void Shell::ResetLayoutManager(int container_id) {
661 GetContainer(container_id)->SetLayoutManager(NULL); 661 GetContainer(container_id)->SetLayoutManager(NULL);
662 } 662 }
663 663
664 void Shell::DisableWorkspaceGridLayout() {
665 if (workspace_controller_.get())
666 workspace_controller_->workspace_manager()->set_grid_size(0);
667 }
668
664 } // namespace ash 669 } // namespace ash
OLDNEW
« no previous file with comments | « ash/shell.h ('k') | ash/shell_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698