| 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 <algorithm> | 7 #include <algorithm> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "athena/activity/public/activity_view_model.h" | 10 #include "athena/activity/public/activity_view_model.h" |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 65 } | 65 } |
| 66 | 66 |
| 67 void ActivityFrameView::GetWindowMask(const gfx::Size& size, | 67 void ActivityFrameView::GetWindowMask(const gfx::Size& size, |
| 68 gfx::Path* window_mask) { | 68 gfx::Path* window_mask) { |
| 69 } | 69 } |
| 70 | 70 |
| 71 void ActivityFrameView::ResetWindowControls() { | 71 void ActivityFrameView::ResetWindowControls() { |
| 72 } | 72 } |
| 73 | 73 |
| 74 void ActivityFrameView::UpdateWindowIcon() { | 74 void ActivityFrameView::UpdateWindowIcon() { |
| 75 if (!view_model_->UsesFrame()) |
| 76 return; |
| 77 |
| 78 SkColor bgcolor = view_model_->GetRepresentativeColor(); |
| 79 set_background(views::Background::CreateSolidBackground(bgcolor)); |
| 80 title_->SetBackgroundColor(bgcolor); |
| 81 SchedulePaint(); |
| 75 } | 82 } |
| 76 | 83 |
| 77 void ActivityFrameView::UpdateWindowTitle() { | 84 void ActivityFrameView::UpdateWindowTitle() { |
| 78 if (!view_model_->UsesFrame()) | 85 if (!view_model_->UsesFrame()) |
| 79 return; | 86 return; |
| 80 | |
| 81 SkColor bgcolor = view_model_->GetRepresentativeColor(); | |
| 82 title_->set_background(views::Background::CreateSolidBackground(bgcolor)); | |
| 83 title_->SetBackgroundColor(bgcolor); | |
| 84 title_->SetText(frame_->widget_delegate()->GetWindowTitle()); | 87 title_->SetText(frame_->widget_delegate()->GetWindowTitle()); |
| 85 } | 88 } |
| 86 | 89 |
| 87 //////////////////////////////////////////////////////////////////////////////// | 90 //////////////////////////////////////////////////////////////////////////////// |
| 88 // ActivityFrameView, views::View overrides: | 91 // ActivityFrameView, views::View overrides: |
| 89 | 92 |
| 90 gfx::Size ActivityFrameView::GetPreferredSize() const { | 93 gfx::Size ActivityFrameView::GetPreferredSize() const { |
| 91 gfx::Size pref = frame_->client_view()->GetPreferredSize(); | 94 gfx::Size pref = frame_->client_view()->GetPreferredSize(); |
| 92 gfx::Rect bounds(0, 0, pref.width(), pref.height()); | 95 gfx::Rect bounds(0, 0, pref.width(), pref.height()); |
| 93 return frame_->non_client_view() | 96 return frame_->non_client_view() |
| (...skipping 11 matching lines...) Expand all Loading... |
| 105 | 108 |
| 106 //////////////////////////////////////////////////////////////////////////////// | 109 //////////////////////////////////////////////////////////////////////////////// |
| 107 // ActivityFrameView, private: | 110 // ActivityFrameView, private: |
| 108 | 111 |
| 109 int ActivityFrameView::NonClientTopBorderHeight() const { | 112 int ActivityFrameView::NonClientTopBorderHeight() const { |
| 110 const int kDefaultTitleHeight = 25; | 113 const int kDefaultTitleHeight = 25; |
| 111 return frame_->IsFullscreen() ? 0 : kDefaultTitleHeight; | 114 return frame_->IsFullscreen() ? 0 : kDefaultTitleHeight; |
| 112 } | 115 } |
| 113 | 116 |
| 114 } // namespace ash | 117 } // namespace ash |
| OLD | NEW |