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

Side by Side Diff: components/exo/shell_surface.cc

Issue 2236583002: exo: Prevent maximize/minimize of shell surface in system modal container. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 "components/exo/shell_surface.h" 5 #include "components/exo/shell_surface.h"
6 6
7 #include "ash/aura/wm_window_aura.h" 7 #include "ash/aura/wm_window_aura.h"
8 #include "ash/common/shell_window_ids.h" 8 #include "ash/common/shell_window_ids.h"
9 #include "ash/common/wm/window_resizer.h" 9 #include "ash/common/wm/window_resizer.h"
10 #include "ash/common/wm/window_state.h" 10 #include "ash/common/wm/window_state.h"
(...skipping 634 matching lines...) Expand 10 before | Expand all | Expand 10 after
645 } 645 }
646 646
647 //////////////////////////////////////////////////////////////////////////////// 647 ////////////////////////////////////////////////////////////////////////////////
648 // views::WidgetDelegate overrides: 648 // views::WidgetDelegate overrides:
649 649
650 bool ShellSurface::CanResize() const { 650 bool ShellSurface::CanResize() const {
651 return initial_bounds_.IsEmpty(); 651 return initial_bounds_.IsEmpty();
652 } 652 }
653 653
654 bool ShellSurface::CanMaximize() const { 654 bool ShellSurface::CanMaximize() const {
655 return true; 655 // Shell surfaces in system modal container cannot be maximized.
656 return container_ != ash::kShellWindowId_SystemModalContainer;
656 } 657 }
657 658
658 bool ShellSurface::CanMinimize() const { 659 bool ShellSurface::CanMinimize() const {
659 return true; 660 // Shell surfaces in system modal container cannot be minimized.
661 return container_ != ash::kShellWindowId_SystemModalContainer;
660 } 662 }
661 663
662 base::string16 ShellSurface::GetWindowTitle() const { 664 base::string16 ShellSurface::GetWindowTitle() const {
663 return title_; 665 return title_;
664 } 666 }
665 667
666 void ShellSurface::WindowClosing() { 668 void ShellSurface::WindowClosing() {
667 if (resizer_) 669 if (resizer_)
668 EndDrag(true /* revert */); 670 EndDrag(true /* revert */);
669 SetEnabled(false); 671 SetEnabled(false);
(...skipping 570 matching lines...) Expand 10 before | Expand all | Expand 10 after
1240 shadow_overlay_->layer()->Add(shadow->layer()); 1242 shadow_overlay_->layer()->Add(shadow->layer());
1241 window->AddChild(shadow_overlay_); 1243 window->AddChild(shadow_overlay_);
1242 shadow_overlay_->Show(); 1244 shadow_overlay_->Show();
1243 } 1245 }
1244 shadow_overlay_->SetBounds(shadow_bounds); 1246 shadow_overlay_->SetBounds(shadow_bounds);
1245 shadow->SetContentBounds(gfx::Rect(shadow_bounds.size())); 1247 shadow->SetContentBounds(gfx::Rect(shadow_bounds.size()));
1246 } 1248 }
1247 } 1249 }
1248 1250
1249 } // namespace exo 1251 } // namespace exo
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698