| 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/frame/custom_frame_view_ash.h" | 5 #include "ash/frame/custom_frame_view_ash.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "ash/frame/caption_buttons/frame_caption_button_container_view.h" | 10 #include "ash/frame/caption_buttons/frame_caption_button_container_view.h" |
| (...skipping 281 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 292 } | 292 } |
| 293 | 293 |
| 294 void CustomFrameViewAsh::ActivationChanged(bool active) { | 294 void CustomFrameViewAsh::ActivationChanged(bool active) { |
| 295 // The icons differ between active and inactive. | 295 // The icons differ between active and inactive. |
| 296 header_view_->SchedulePaint(); | 296 header_view_->SchedulePaint(); |
| 297 } | 297 } |
| 298 | 298 |
| 299 //////////////////////////////////////////////////////////////////////////////// | 299 //////////////////////////////////////////////////////////////////////////////// |
| 300 // CustomFrameViewAsh, views::View overrides: | 300 // CustomFrameViewAsh, views::View overrides: |
| 301 | 301 |
| 302 gfx::Size CustomFrameViewAsh::GetPreferredSize() const { | 302 gfx::Size CustomFrameViewAsh::CalculatePreferredSize() const { |
| 303 gfx::Size pref = frame_->client_view()->GetPreferredSize(); | 303 gfx::Size pref = frame_->client_view()->GetPreferredSize(); |
| 304 gfx::Rect bounds(0, 0, pref.width(), pref.height()); | 304 gfx::Rect bounds(0, 0, pref.width(), pref.height()); |
| 305 return frame_->non_client_view() | 305 return frame_->non_client_view() |
| 306 ->GetWindowBoundsForClientBounds(bounds) | 306 ->GetWindowBoundsForClientBounds(bounds) |
| 307 .size(); | 307 .size(); |
| 308 } | 308 } |
| 309 | 309 |
| 310 void CustomFrameViewAsh::Layout() { | 310 void CustomFrameViewAsh::Layout() { |
| 311 views::NonClientFrameView::Layout(); | 311 views::NonClientFrameView::Layout(); |
| 312 WmWindow* frame_window = WmWindow::Get(frame_->GetNativeWindow()); | 312 WmWindow* frame_window = WmWindow::Get(frame_->GetNativeWindow()); |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 380 FrameCaptionButtonContainerView* | 380 FrameCaptionButtonContainerView* |
| 381 CustomFrameViewAsh::GetFrameCaptionButtonContainerViewForTest() { | 381 CustomFrameViewAsh::GetFrameCaptionButtonContainerViewForTest() { |
| 382 return header_view_->caption_button_container(); | 382 return header_view_->caption_button_container(); |
| 383 } | 383 } |
| 384 | 384 |
| 385 int CustomFrameViewAsh::NonClientTopBorderHeight() const { | 385 int CustomFrameViewAsh::NonClientTopBorderHeight() const { |
| 386 return frame_->IsFullscreen() ? 0 : header_view_->GetPreferredHeight(); | 386 return frame_->IsFullscreen() ? 0 : header_view_->GetPreferredHeight(); |
| 387 } | 387 } |
| 388 | 388 |
| 389 } // namespace ash | 389 } // namespace ash |
| OLD | NEW |