| 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/toplevel_window.h" | 5 #include "ash/shell/toplevel_window.h" |
| 6 | 6 |
| 7 #include "ash/display/display_controller.h" | 7 #include "ash/display/display_controller.h" |
| 8 #include "ash/screen_ash.h" | 8 #include "ash/screen_ash.h" |
| 9 #include "ash/shell.h" | 9 #include "ash/shell.h" |
| 10 #include "ash/wm/window_positioner.h" | 10 #include "ash/wm/window_positioner.h" |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 69 | 69 |
| 70 void ToplevelWindow::SaveWindowPlacement(const gfx::Rect& bounds, | 70 void ToplevelWindow::SaveWindowPlacement(const gfx::Rect& bounds, |
| 71 ui::WindowShowState show_state) { | 71 ui::WindowShowState show_state) { |
| 72 if (!saved_state) | 72 if (!saved_state) |
| 73 saved_state = new SavedState; | 73 saved_state = new SavedState; |
| 74 saved_state->bounds = bounds; | 74 saved_state->bounds = bounds; |
| 75 saved_state->show_state = show_state; | 75 saved_state->show_state = show_state; |
| 76 } | 76 } |
| 77 | 77 |
| 78 bool ToplevelWindow::GetSavedWindowPlacement( | 78 bool ToplevelWindow::GetSavedWindowPlacement( |
| 79 const views::Widget* widget, |
| 79 gfx::Rect* bounds, | 80 gfx::Rect* bounds, |
| 80 ui::WindowShowState* show_state) const { | 81 ui::WindowShowState* show_state) const { |
| 81 bool is_saved_bounds = !!saved_state; | 82 bool is_saved_bounds = !!saved_state; |
| 82 if (saved_state) { | 83 if (saved_state) { |
| 83 *bounds = saved_state->bounds; | 84 *bounds = saved_state->bounds; |
| 84 *show_state = saved_state->show_state; | 85 *show_state = saved_state->show_state; |
| 85 } else { | 86 } else { |
| 86 // Initial default bounds. | 87 // Initial default bounds. |
| 87 bounds->SetRect(10, 150, 300, 300); | 88 bounds->SetRect(10, 150, 300, 300); |
| 88 } | 89 } |
| (...skipping 14 matching lines...) Expand all Loading... |
| 103 bool ToplevelWindow::CanResize() const { | 104 bool ToplevelWindow::CanResize() const { |
| 104 return params_.can_resize; | 105 return params_.can_resize; |
| 105 } | 106 } |
| 106 | 107 |
| 107 bool ToplevelWindow::CanMaximize() const { | 108 bool ToplevelWindow::CanMaximize() const { |
| 108 return params_.can_maximize; | 109 return params_.can_maximize; |
| 109 } | 110 } |
| 110 | 111 |
| 111 } // namespace shell | 112 } // namespace shell |
| 112 } // namespace ash | 113 } // namespace ash |
| OLD | NEW |