| OLD | NEW |
| 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 633 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 644 } | 644 } |
| 645 | 645 |
| 646 //////////////////////////////////////////////////////////////////////////////// | 646 //////////////////////////////////////////////////////////////////////////////// |
| 647 // views::WidgetDelegate overrides: | 647 // views::WidgetDelegate overrides: |
| 648 | 648 |
| 649 bool ShellSurface::CanResize() const { | 649 bool ShellSurface::CanResize() const { |
| 650 return initial_bounds_.IsEmpty(); | 650 return initial_bounds_.IsEmpty(); |
| 651 } | 651 } |
| 652 | 652 |
| 653 bool ShellSurface::CanMaximize() const { | 653 bool ShellSurface::CanMaximize() const { |
| 654 return true; | 654 // Shell surfaces in system modal container cannot be maximized. |
| 655 return container_ != ash::kShellWindowId_SystemModalContainer; |
| 655 } | 656 } |
| 656 | 657 |
| 657 bool ShellSurface::CanMinimize() const { | 658 bool ShellSurface::CanMinimize() const { |
| 658 return true; | 659 // Shell surfaces in system modal container cannot be minimized. |
| 660 return container_ != ash::kShellWindowId_SystemModalContainer; |
| 659 } | 661 } |
| 660 | 662 |
| 661 base::string16 ShellSurface::GetWindowTitle() const { | 663 base::string16 ShellSurface::GetWindowTitle() const { |
| 662 return title_; | 664 return title_; |
| 663 } | 665 } |
| 664 | 666 |
| 665 void ShellSurface::WindowClosing() { | 667 void ShellSurface::WindowClosing() { |
| 666 if (resizer_) | 668 if (resizer_) |
| 667 EndDrag(true /* revert */); | 669 EndDrag(true /* revert */); |
| 668 SetEnabled(false); | 670 SetEnabled(false); |
| (...skipping 575 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1244 shadow_overlay_->layer()->Add(shadow->layer()); | 1246 shadow_overlay_->layer()->Add(shadow->layer()); |
| 1245 window->AddChild(shadow_overlay_); | 1247 window->AddChild(shadow_overlay_); |
| 1246 shadow_overlay_->Show(); | 1248 shadow_overlay_->Show(); |
| 1247 } | 1249 } |
| 1248 shadow_overlay_->SetBounds(shadow_bounds); | 1250 shadow_overlay_->SetBounds(shadow_bounds); |
| 1249 shadow->SetContentBounds(gfx::Rect(shadow_bounds.size())); | 1251 shadow->SetContentBounds(gfx::Rect(shadow_bounds.size())); |
| 1250 } | 1252 } |
| 1251 } | 1253 } |
| 1252 | 1254 |
| 1253 } // namespace exo | 1255 } // namespace exo |
| OLD | NEW |