| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/common/frame/header_view.h" | 5 #include "ash/common/frame/header_view.h" |
| 6 | 6 |
| 7 #include "ash/common/frame/caption_buttons/frame_caption_button_container_view.h
" | 7 #include "ash/common/frame/caption_buttons/frame_caption_button_container_view.h
" |
| 8 #include "ash/common/frame/default_header_painter.h" | 8 #include "ash/common/frame/default_header_painter.h" |
| 9 #include "ash/common/material_design/material_design_controller.h" | |
| 10 #include "ash/common/session/session_state_delegate.h" | 9 #include "ash/common/session/session_state_delegate.h" |
| 11 #include "ash/common/wm_lookup.h" | 10 #include "ash/common/wm_lookup.h" |
| 12 #include "ash/common/wm_shell.h" | 11 #include "ash/common/wm_shell.h" |
| 13 #include "ui/gfx/canvas.h" | 12 #include "ui/gfx/canvas.h" |
| 14 #include "ui/views/controls/image_view.h" | 13 #include "ui/views/controls/image_view.h" |
| 15 #include "ui/views/widget/widget.h" | 14 #include "ui/views/widget/widget.h" |
| 16 | 15 |
| 17 namespace ash { | 16 namespace ash { |
| 18 | 17 |
| 19 HeaderView::HeaderView(views::Widget* target_widget) | 18 HeaderView::HeaderView(views::Widget* target_widget) |
| (...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 127 // size changes. | 126 // size changes. |
| 128 if (child != caption_button_container_) | 127 if (child != caption_button_container_) |
| 129 return; | 128 return; |
| 130 parent()->Layout(); | 129 parent()->Layout(); |
| 131 } | 130 } |
| 132 | 131 |
| 133 /////////////////////////////////////////////////////////////////////////////// | 132 /////////////////////////////////////////////////////////////////////////////// |
| 134 // HeaderView, ShellObserver overrides: | 133 // HeaderView, ShellObserver overrides: |
| 135 | 134 |
| 136 void HeaderView::OnOverviewModeStarting() { | 135 void HeaderView::OnOverviewModeStarting() { |
| 137 if (MaterialDesignController::IsOverviewMaterial()) | 136 caption_button_container_->SetVisible(false); |
| 138 caption_button_container_->SetVisible(false); | |
| 139 } | 137 } |
| 140 | 138 |
| 141 void HeaderView::OnOverviewModeEnded() { | 139 void HeaderView::OnOverviewModeEnded() { |
| 142 if (MaterialDesignController::IsOverviewMaterial()) | 140 caption_button_container_->SetVisible(true); |
| 143 caption_button_container_->SetVisible(true); | |
| 144 } | 141 } |
| 145 | 142 |
| 146 void HeaderView::OnMaximizeModeStarted() { | 143 void HeaderView::OnMaximizeModeStarted() { |
| 147 caption_button_container_->UpdateSizeButtonVisibility(); | 144 caption_button_container_->UpdateSizeButtonVisibility(); |
| 148 parent()->Layout(); | 145 parent()->Layout(); |
| 149 } | 146 } |
| 150 | 147 |
| 151 void HeaderView::OnMaximizeModeEnded() { | 148 void HeaderView::OnMaximizeModeEnded() { |
| 152 caption_button_container_->UpdateSizeButtonVisibility(); | 149 caption_button_container_->UpdateSizeButtonVisibility(); |
| 153 parent()->Layout(); | 150 parent()->Layout(); |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 192 gfx::Rect visible_bounds(GetVisibleBounds()); | 189 gfx::Rect visible_bounds(GetVisibleBounds()); |
| 193 gfx::Point visible_origin_in_screen(visible_bounds.origin()); | 190 gfx::Point visible_origin_in_screen(visible_bounds.origin()); |
| 194 views::View::ConvertPointToScreen(this, &visible_origin_in_screen); | 191 views::View::ConvertPointToScreen(this, &visible_origin_in_screen); |
| 195 std::vector<gfx::Rect> bounds_in_screen; | 192 std::vector<gfx::Rect> bounds_in_screen; |
| 196 bounds_in_screen.push_back( | 193 bounds_in_screen.push_back( |
| 197 gfx::Rect(visible_origin_in_screen, visible_bounds.size())); | 194 gfx::Rect(visible_origin_in_screen, visible_bounds.size())); |
| 198 return bounds_in_screen; | 195 return bounds_in_screen; |
| 199 } | 196 } |
| 200 | 197 |
| 201 } // namespace ash | 198 } // namespace ash |
| OLD | NEW |