| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "athena/activity/activity_frame_view.h" | 5 #include "athena/activity/activity_frame_view.h" |
| 6 | 6 |
| 7 #include "athena/activity/public/activity_view_model.h" | 7 #include "athena/activity/public/activity_view_model.h" |
| 8 #include "athena/wm/public/window_manager.h" | 8 #include "athena/wm/public/window_manager.h" |
| 9 #include "third_party/skia/include/core/SkBitmap.h" | 9 #include "third_party/skia/include/core/SkBitmap.h" |
| 10 #include "ui/base/hit_test.h" | 10 #include "ui/base/hit_test.h" |
| (...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 114 SchedulePaint(); | 114 SchedulePaint(); |
| 115 } | 115 } |
| 116 | 116 |
| 117 void ActivityFrameView::UpdateWindowTitle() { | 117 void ActivityFrameView::UpdateWindowTitle() { |
| 118 if (!view_model_->UsesFrame()) | 118 if (!view_model_->UsesFrame()) |
| 119 return; | 119 return; |
| 120 title_->SetText(frame_->widget_delegate()->GetWindowTitle()); | 120 title_->SetText(frame_->widget_delegate()->GetWindowTitle()); |
| 121 Layout(); | 121 Layout(); |
| 122 } | 122 } |
| 123 | 123 |
| 124 void ActivityFrameView::SizeConstraintsChanged() { |
| 125 } |
| 126 |
| 124 gfx::Size ActivityFrameView::GetPreferredSize() const { | 127 gfx::Size ActivityFrameView::GetPreferredSize() const { |
| 125 gfx::Size pref = frame_->client_view()->GetPreferredSize(); | 128 gfx::Size pref = frame_->client_view()->GetPreferredSize(); |
| 126 gfx::Rect bounds(0, 0, pref.width(), pref.height()); | 129 gfx::Rect bounds(0, 0, pref.width(), pref.height()); |
| 127 return frame_->non_client_view() | 130 return frame_->non_client_view() |
| 128 ->GetWindowBoundsForClientBounds(bounds) | 131 ->GetWindowBoundsForClientBounds(bounds) |
| 129 .size(); | 132 .size(); |
| 130 } | 133 } |
| 131 | 134 |
| 132 const char* ActivityFrameView::GetClassName() const { | 135 const char* ActivityFrameView::GetClassName() const { |
| 133 return kViewClassName; | 136 return kViewClassName; |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 207 return in_overview_ ? kOverviewBorderThickness : 0; | 210 return in_overview_ ? kOverviewBorderThickness : 0; |
| 208 } | 211 } |
| 209 | 212 |
| 210 int ActivityFrameView::NonClientTopBorderHeight() const { | 213 int ActivityFrameView::NonClientTopBorderHeight() const { |
| 211 if (frame_->IsFullscreen() || !view_model_->UsesFrame()) | 214 if (frame_->IsFullscreen() || !view_model_->UsesFrame()) |
| 212 return in_overview_ ? kOverviewShortTitleHeight : 0; | 215 return in_overview_ ? kOverviewShortTitleHeight : 0; |
| 213 return in_overview_ ? kOverviewTitleHeight : kDefaultTitleHeight; | 216 return in_overview_ ? kOverviewTitleHeight : kDefaultTitleHeight; |
| 214 } | 217 } |
| 215 | 218 |
| 216 } // namespace athena | 219 } // namespace athena |
| OLD | NEW |