Chromium Code Reviews| 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/wm/custom_frame_view_ash.h" | 5 #include "ash/wm/custom_frame_view_ash.h" |
| 6 | 6 |
| 7 #include "ash/wm/frame_painter.h" | 7 #include "ash/wm/frame_painter.h" |
| 8 #include "ash/wm/workspace/frame_maximize_button.h" | 8 #include "ash/wm/workspace/frame_maximize_button.h" |
| 9 #include "grit/ui_resources.h" | 9 #include "grit/ui_resources.h" |
| 10 #include "grit/ui_strings.h" // Accessibility names | 10 #include "grit/ui_strings.h" // Accessibility names |
| (...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 141 return frame_painter_->GetMinimumSize(this); | 141 return frame_painter_->GetMinimumSize(this); |
| 142 } | 142 } |
| 143 | 143 |
| 144 //////////////////////////////////////////////////////////////////////////////// | 144 //////////////////////////////////////////////////////////////////////////////// |
| 145 // views::ButtonListener overrides: | 145 // views::ButtonListener overrides: |
| 146 void CustomFrameViewAsh::ButtonPressed(views::Button* sender, | 146 void CustomFrameViewAsh::ButtonPressed(views::Button* sender, |
| 147 const ui::Event& event) { | 147 const ui::Event& event) { |
| 148 if (sender == maximize_button_) { | 148 if (sender == maximize_button_) { |
| 149 // The maximize button may move out from under the cursor. | 149 // The maximize button may move out from under the cursor. |
| 150 ResetWindowControls(); | 150 ResetWindowControls(); |
| 151 if (frame_->IsMaximized()) | 151 maximize_button_->ToggleMaximize(); |
|
sky
2012/08/27 22:18:16
ToggleMaximized
Mr4D (OOO till 08-26)
2012/08/28 01:30:25
Done.
| |
| 152 frame_->Restore(); | |
| 153 else | |
| 154 frame_->Maximize(); | |
| 155 // |this| may be deleted - some windows delete their frames on maximize. | 152 // |this| may be deleted - some windows delete their frames on maximize. |
| 156 } else if (sender == close_button_) { | 153 } else if (sender == close_button_) { |
| 157 frame_->Close(); | 154 frame_->Close(); |
| 158 } | 155 } |
| 159 } | 156 } |
| 160 | 157 |
| 161 //////////////////////////////////////////////////////////////////////////////// | 158 //////////////////////////////////////////////////////////////////////////////// |
| 162 // CustomFrameViewAsh, private: | 159 // CustomFrameViewAsh, private: |
| 163 | 160 |
| 164 int CustomFrameViewAsh::NonClientTopBorderHeight() const { | 161 int CustomFrameViewAsh::NonClientTopBorderHeight() const { |
| 165 // Reserve enough space to see the buttons, including any offset from top and | 162 // Reserve enough space to see the buttons, including any offset from top and |
| 166 // reserving space for the separator line. | 163 // reserving space for the separator line. |
| 167 return close_button_->bounds().bottom() + | 164 return close_button_->bounds().bottom() + |
| 168 frame_painter_->HeaderContentSeparatorSize(); | 165 frame_painter_->HeaderContentSeparatorSize(); |
| 169 } | 166 } |
| 170 | 167 |
| 171 } // namespace ash | 168 } // namespace ash |
| OLD | NEW |