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 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
137 return kViewClassName; | 137 return kViewClassName; |
138 } | 138 } |
139 | 139 |
140 gfx::Size CustomFrameViewAsh::GetMinimumSize() { | 140 gfx::Size CustomFrameViewAsh::GetMinimumSize() { |
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 views::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 if (frame_->IsMaximized()) |
152 frame_->Restore(); | 152 frame_->Restore(); |
153 else | 153 else |
154 frame_->Maximize(); | 154 frame_->Maximize(); |
155 // |this| may be deleted - some windows delete their frames on maximize. | 155 // |this| may be deleted - some windows delete their frames on maximize. |
156 } else if (sender == close_button_) { | 156 } else if (sender == close_button_) { |
157 frame_->Close(); | 157 frame_->Close(); |
158 } | 158 } |
159 } | 159 } |
160 | 160 |
161 //////////////////////////////////////////////////////////////////////////////// | 161 //////////////////////////////////////////////////////////////////////////////// |
162 // CustomFrameViewAsh, private: | 162 // CustomFrameViewAsh, private: |
163 | 163 |
164 int CustomFrameViewAsh::NonClientTopBorderHeight() const { | 164 int CustomFrameViewAsh::NonClientTopBorderHeight() const { |
165 // Reserve enough space to see the buttons, including any offset from top and | 165 // Reserve enough space to see the buttons, including any offset from top and |
166 // reserving space for the separator line. | 166 // reserving space for the separator line. |
167 return close_button_->bounds().bottom() + | 167 return close_button_->bounds().bottom() + |
168 frame_painter_->HeaderContentSeparatorSize(); | 168 frame_painter_->HeaderContentSeparatorSize(); |
169 } | 169 } |
170 | 170 |
171 } // namespace ash | 171 } // namespace ash |
OLD | NEW |