Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(280)

Side by Side Diff: athena/activity/activity_frame_view.cc

Issue 549593002: athena: Make sure the window captions update correctly for theme-color. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | athena/activity/activity_view_manager_impl.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « no previous file | athena/activity/activity_view_manager_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698