OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/frame/caption_buttons/frame_caption_button_container_view.h" | 5 #include "ash/frame/caption_buttons/frame_caption_button_container_view.h" |
6 | 6 |
7 #include <cmath> | 7 #include <cmath> |
8 | 8 |
9 #include "ash/ash_switches.h" | 9 #include "ash/ash_switches.h" |
10 #include "ash/frame/caption_buttons/frame_caption_button.h" | 10 #include "ash/frame/caption_buttons/frame_caption_button.h" |
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
124 // TODO(flackr): Refactor the Maximize Mode notifications. Currently | 124 // TODO(flackr): Refactor the Maximize Mode notifications. Currently |
125 // UpdateSizeButtonVisibilty requires a force_hidden parameter. This is | 125 // UpdateSizeButtonVisibilty requires a force_hidden parameter. This is |
126 // because Shell::IsMaximizeWindowManagerEnabled is still false at the | 126 // because Shell::IsMaximizeWindowManagerEnabled is still false at the |
127 // time when ShellObserver::OnMaximizeModeStarted is called. This prevents | 127 // time when ShellObserver::OnMaximizeModeStarted is called. This prevents |
128 // this method from performing that check, and instead relies on the calling | 128 // this method from performing that check, and instead relies on the calling |
129 // code to tell it to force being hidden. | 129 // code to tell it to force being hidden. |
130 size_button_->SetVisible( | 130 size_button_->SetVisible( |
131 !force_hidden && frame_->widget_delegate()->CanMaximize()); | 131 !force_hidden && frame_->widget_delegate()->CanMaximize()); |
132 } | 132 } |
133 | 133 |
134 gfx::Size FrameCaptionButtonContainerView::GetPreferredSize() { | 134 gfx::Size FrameCaptionButtonContainerView::GetPreferredSize() const { |
135 int width = 0; | 135 int width = 0; |
136 for (int i = 0; i < child_count(); ++i) { | 136 for (int i = 0; i < child_count(); ++i) { |
137 views::View* child = child_at(i); | 137 const views::View* child = child_at(i); |
138 if (child->visible()) | 138 if (child->visible()) |
139 width += child_at(i)->GetPreferredSize().width(); | 139 width += child_at(i)->GetPreferredSize().width(); |
140 } | 140 } |
141 return gfx::Size(width, close_button_->GetPreferredSize().height()); | 141 return gfx::Size(width, close_button_->GetPreferredSize().height()); |
142 } | 142 } |
143 | 143 |
144 void FrameCaptionButtonContainerView::Layout() { | 144 void FrameCaptionButtonContainerView::Layout() { |
145 int x = 0; | 145 int x = 0; |
146 for (int i = 0; i < child_count(); ++i) { | 146 for (int i = 0; i < child_count(); ++i) { |
147 views::View* child = child_at(i); | 147 views::View* child = child_at(i); |
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
304 : icon_image_id(icon_id), | 304 : icon_image_id(icon_id), |
305 inactive_icon_image_id(inactive_icon_id), | 305 inactive_icon_image_id(inactive_icon_id), |
306 hovered_background_image_id(hovered_background_id), | 306 hovered_background_image_id(hovered_background_id), |
307 pressed_background_image_id(pressed_background_id) { | 307 pressed_background_image_id(pressed_background_id) { |
308 } | 308 } |
309 | 309 |
310 FrameCaptionButtonContainerView::ButtonIconIds::~ButtonIconIds() { | 310 FrameCaptionButtonContainerView::ButtonIconIds::~ButtonIconIds() { |
311 } | 311 } |
312 | 312 |
313 } // namespace ash | 313 } // namespace ash |
OLD | NEW |