| 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 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 60 l10n_util::GetStringUTF16(IDS_APP_ACCNAME_CLOSE)); | 60 l10n_util::GetStringUTF16(IDS_APP_ACCNAME_CLOSE)); |
| 61 AddChildView(close_button_); | 61 AddChildView(close_button_); |
| 62 | 62 |
| 63 maximize_button_->SetVisible(frame_->widget_delegate()->CanMaximize()); | 63 maximize_button_->SetVisible(frame_->widget_delegate()->CanMaximize()); |
| 64 | 64 |
| 65 if (frame_->widget_delegate()->ShouldShowWindowIcon()) { | 65 if (frame_->widget_delegate()->ShouldShowWindowIcon()) { |
| 66 window_icon_ = new views::ImageButton(this); | 66 window_icon_ = new views::ImageButton(this); |
| 67 AddChildView(window_icon_); | 67 AddChildView(window_icon_); |
| 68 } | 68 } |
| 69 | 69 |
| 70 frame_painter_->Init(frame_, window_icon_, maximize_button_, close_button_); | 70 frame_painter_->Init(frame_, window_icon_, maximize_button_, close_button_, |
| 71 FramePainter::SIZE_BUTTON_MAXIMIZES); |
| 71 } | 72 } |
| 72 | 73 |
| 73 //////////////////////////////////////////////////////////////////////////////// | 74 //////////////////////////////////////////////////////////////////////////////// |
| 74 // CustomFrameViewAsh, views::NonClientFrameView overrides: | 75 // CustomFrameViewAsh, views::NonClientFrameView overrides: |
| 75 gfx::Rect CustomFrameViewAsh::GetBoundsForClientView() const { | 76 gfx::Rect CustomFrameViewAsh::GetBoundsForClientView() const { |
| 76 int top_height = NonClientTopBorderHeight(); | 77 int top_height = NonClientTopBorderHeight(); |
| 77 return frame_painter_->GetBoundsForClientView(top_height, | 78 return frame_painter_->GetBoundsForClientView(top_height, |
| 78 bounds()); | 79 bounds()); |
| 79 } | 80 } |
| 80 | 81 |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 163 // CustomFrameViewAsh, private: | 164 // CustomFrameViewAsh, private: |
| 164 | 165 |
| 165 int CustomFrameViewAsh::NonClientTopBorderHeight() const { | 166 int CustomFrameViewAsh::NonClientTopBorderHeight() const { |
| 166 // Reserve enough space to see the buttons, including any offset from top and | 167 // Reserve enough space to see the buttons, including any offset from top and |
| 167 // reserving space for the separator line. | 168 // reserving space for the separator line. |
| 168 return close_button_->bounds().bottom() + | 169 return close_button_->bounds().bottom() + |
| 169 frame_painter_->HeaderContentSeparatorSize(); | 170 frame_painter_->HeaderContentSeparatorSize(); |
| 170 } | 171 } |
| 171 | 172 |
| 172 } // namespace ash | 173 } // namespace ash |
| OLD | NEW |