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/caption_buttons/frame_caption_button_container_view.h" | 7 #include "ash/wm/caption_buttons/frame_caption_button_container_view.h" |
8 #include "ash/wm/frame_border_hit_test_controller.h" | 8 #include "ash/wm/frame_border_hit_test_controller.h" |
9 #include "ash/wm/header_painter.h" | 9 #include "ash/wm/header_painter.h" |
| 10 #include "ash/wm/window_state.h" |
10 #include "grit/ash_resources.h" | 11 #include "grit/ash_resources.h" |
11 #include "ui/gfx/canvas.h" | 12 #include "ui/gfx/canvas.h" |
12 #include "ui/gfx/font.h" | 13 #include "ui/gfx/font.h" |
13 #include "ui/gfx/rect.h" | 14 #include "ui/gfx/rect.h" |
14 #include "ui/gfx/size.h" | 15 #include "ui/gfx/size.h" |
15 #include "ui/views/widget/native_widget_aura.h" | 16 #include "ui/views/widget/native_widget_aura.h" |
16 #include "ui/views/widget/widget.h" | 17 #include "ui/views/widget/widget.h" |
17 #include "ui/views/widget/widget_delegate.h" | 18 #include "ui/views/widget/widget_delegate.h" |
18 | 19 |
19 namespace { | 20 namespace { |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
84 caption_button_container_->ResetWindowControls(); | 85 caption_button_container_->ResetWindowControls(); |
85 } | 86 } |
86 | 87 |
87 void CustomFrameViewAsh::UpdateWindowIcon() { | 88 void CustomFrameViewAsh::UpdateWindowIcon() { |
88 } | 89 } |
89 | 90 |
90 void CustomFrameViewAsh::UpdateWindowTitle() { | 91 void CustomFrameViewAsh::UpdateWindowTitle() { |
91 header_painter_->SchedulePaintForTitle(GetTitleFont()); | 92 header_painter_->SchedulePaintForTitle(GetTitleFont()); |
92 } | 93 } |
93 | 94 |
| 95 bool CustomFrameViewAsh::IsDocked() const { |
| 96 return ash::wm::GetWindowState(frame_->GetNativeWindow())->IsDocked(); |
| 97 } |
| 98 |
94 //////////////////////////////////////////////////////////////////////////////// | 99 //////////////////////////////////////////////////////////////////////////////// |
95 // CustomFrameViewAsh, views::View overrides: | 100 // CustomFrameViewAsh, views::View overrides: |
96 | 101 |
97 gfx::Size CustomFrameViewAsh::GetPreferredSize() { | 102 gfx::Size CustomFrameViewAsh::GetPreferredSize() { |
98 gfx::Size pref = frame_->client_view()->GetPreferredSize(); | 103 gfx::Size pref = frame_->client_view()->GetPreferredSize(); |
99 gfx::Rect bounds(0, 0, pref.width(), pref.height()); | 104 gfx::Rect bounds(0, 0, pref.width(), pref.height()); |
100 return frame_->non_client_view()->GetWindowBoundsForClientBounds( | 105 return frame_->non_client_view()->GetWindowBoundsForClientBounds( |
101 bounds).size(); | 106 bounds).size(); |
102 } | 107 } |
103 | 108 |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
158 if (frame_->IsFullscreen()) | 163 if (frame_->IsFullscreen()) |
159 return 0; | 164 return 0; |
160 | 165 |
161 // Reserve enough space to see the buttons, including any offset from top and | 166 // Reserve enough space to see the buttons, including any offset from top and |
162 // reserving space for the separator line. | 167 // reserving space for the separator line. |
163 return caption_button_container_->bounds().bottom() + | 168 return caption_button_container_->bounds().bottom() + |
164 header_painter_->HeaderContentSeparatorSize(); | 169 header_painter_->HeaderContentSeparatorSize(); |
165 } | 170 } |
166 | 171 |
167 } // namespace ash | 172 } // namespace ash |
OLD | NEW |