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/ash_resources.h" | 9 #include "grit/ash_resources.h" |
10 #include "grit/ui_strings.h" // Accessibility names | 10 #include "grit/ui_strings.h" // Accessibility names |
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
118 return frame_->non_client_view()->GetWindowBoundsForClientBounds( | 118 return frame_->non_client_view()->GetWindowBoundsForClientBounds( |
119 bounds).size(); | 119 bounds).size(); |
120 } | 120 } |
121 | 121 |
122 void CustomFrameViewAsh::Layout() { | 122 void CustomFrameViewAsh::Layout() { |
123 // Use the shorter maximized layout headers. | 123 // Use the shorter maximized layout headers. |
124 frame_painter_->LayoutHeader(this, true); | 124 frame_painter_->LayoutHeader(this, true); |
125 } | 125 } |
126 | 126 |
127 void CustomFrameViewAsh::OnPaint(gfx::Canvas* canvas) { | 127 void CustomFrameViewAsh::OnPaint(gfx::Canvas* canvas) { |
128 if (frame_->IsFullscreen()) | |
Ben Goodger (Google)
2012/10/08 18:20:00
Would your change to NonClientTopBorderHeight() re
jeremya
2012/10/08 18:25:16
OnPaint still seems to get called when NonClientTo
| |
129 return; | |
130 | |
128 bool paint_as_active = ShouldPaintAsActive(); | 131 bool paint_as_active = ShouldPaintAsActive(); |
129 int theme_image_id = paint_as_active ? IDR_AURA_WINDOW_HEADER_BASE_ACTIVE : | 132 int theme_image_id = paint_as_active ? IDR_AURA_WINDOW_HEADER_BASE_ACTIVE : |
130 IDR_AURA_WINDOW_HEADER_BASE_INACTIVE; | 133 IDR_AURA_WINDOW_HEADER_BASE_INACTIVE; |
131 frame_painter_->PaintHeader( | 134 frame_painter_->PaintHeader( |
132 this, | 135 this, |
133 canvas, | 136 canvas, |
134 paint_as_active ? FramePainter::ACTIVE : FramePainter::INACTIVE, | 137 paint_as_active ? FramePainter::ACTIVE : FramePainter::INACTIVE, |
135 theme_image_id, | 138 theme_image_id, |
136 NULL); | 139 NULL); |
137 frame_painter_->PaintTitleBar(this, canvas, GetTitleFont()); | 140 frame_painter_->PaintTitleBar(this, canvas, GetTitleFont()); |
(...skipping 26 matching lines...) Expand all Loading... | |
164 frame_->Close(); | 167 frame_->Close(); |
165 } | 168 } |
166 if (event.IsShiftDown()) | 169 if (event.IsShiftDown()) |
167 ui::LayerAnimator::set_slow_animation_mode(false); | 170 ui::LayerAnimator::set_slow_animation_mode(false); |
168 } | 171 } |
169 | 172 |
170 //////////////////////////////////////////////////////////////////////////////// | 173 //////////////////////////////////////////////////////////////////////////////// |
171 // CustomFrameViewAsh, private: | 174 // CustomFrameViewAsh, private: |
172 | 175 |
173 int CustomFrameViewAsh::NonClientTopBorderHeight() const { | 176 int CustomFrameViewAsh::NonClientTopBorderHeight() const { |
177 if (frame_->IsFullscreen()) | |
178 return 0; | |
179 | |
174 // Reserve enough space to see the buttons, including any offset from top and | 180 // Reserve enough space to see the buttons, including any offset from top and |
175 // reserving space for the separator line. | 181 // reserving space for the separator line. |
176 return close_button_->bounds().bottom() + | 182 return close_button_->bounds().bottom() + |
177 frame_painter_->HeaderContentSeparatorSize(); | 183 frame_painter_->HeaderContentSeparatorSize(); |
178 } | 184 } |
179 | 185 |
180 } // namespace ash | 186 } // namespace ash |
OLD | NEW |