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 "ui/base/hit_test.h" | 9 #include "ui/base/hit_test.h" |
10 #include "ui/gfx/canvas.h" | 10 #include "ui/gfx/canvas.h" |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
52 icon_(new views::ImageView), | 52 icon_(new views::ImageView), |
53 in_overview_(false) { | 53 in_overview_(false) { |
54 title_->SetEnabledColor(SkColorSetA(SK_ColorBLACK, 0xe5)); | 54 title_->SetEnabledColor(SkColorSetA(SK_ColorBLACK, 0xe5)); |
55 | 55 |
56 AddChildView(title_); | 56 AddChildView(title_); |
57 AddChildView(icon_); | 57 AddChildView(icon_); |
58 | 58 |
59 UpdateWindowTitle(); | 59 UpdateWindowTitle(); |
60 UpdateWindowIcon(); | 60 UpdateWindowIcon(); |
61 | 61 |
62 WindowManager::GetInstance()->AddObserver(this); | 62 WindowManager::Get()->AddObserver(this); |
63 } | 63 } |
64 | 64 |
65 ActivityFrameView::~ActivityFrameView() { | 65 ActivityFrameView::~ActivityFrameView() { |
66 WindowManager::GetInstance()->RemoveObserver(this); | 66 WindowManager::Get()->RemoveObserver(this); |
67 } | 67 } |
68 | 68 |
69 gfx::Rect ActivityFrameView::GetBoundsForClientView() const { | 69 gfx::Rect ActivityFrameView::GetBoundsForClientView() const { |
70 gfx::Rect client_bounds = bounds(); | 70 gfx::Rect client_bounds = bounds(); |
71 client_bounds.Inset(NonClientBorderInsets()); | 71 client_bounds.Inset(NonClientBorderInsets()); |
72 return client_bounds; | 72 return client_bounds; |
73 } | 73 } |
74 | 74 |
75 gfx::Rect ActivityFrameView::GetWindowBoundsForClientBounds( | 75 gfx::Rect ActivityFrameView::GetWindowBoundsForClientBounds( |
76 const gfx::Rect& client_bounds) const { | 76 const gfx::Rect& client_bounds) const { |
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
205 return in_overview_ ? kOverviewBorderThickness : 0; | 205 return in_overview_ ? kOverviewBorderThickness : 0; |
206 } | 206 } |
207 | 207 |
208 int ActivityFrameView::NonClientTopBorderHeight() const { | 208 int ActivityFrameView::NonClientTopBorderHeight() const { |
209 if (frame_->IsFullscreen() || !view_model_->UsesFrame()) | 209 if (frame_->IsFullscreen() || !view_model_->UsesFrame()) |
210 return in_overview_ ? kOverviewShortTitleHeight : 0; | 210 return in_overview_ ? kOverviewShortTitleHeight : 0; |
211 return in_overview_ ? kOverviewTitleHeight : kDefaultTitleHeight; | 211 return in_overview_ ? kOverviewTitleHeight : kDefaultTitleHeight; |
212 } | 212 } |
213 | 213 |
214 } // namespace athena | 214 } // namespace athena |
OLD | NEW |