athena: Make sure the window captions update correctly for theme-color.

Make sure the Activity is updated when the theme-color changes. Also, update the
background color from UpdateWindowIcon() override, instead of from UpdateWindowTitle(),
since the latter doesn't get called if the title didn't actually change, and so
just changing the color doesn't actually update the view.

BUG=none
R=oshima@chromium.org

Review URL: https://codereview.chromium.org/549593002

Cr-Commit-Position: refs/heads/master@{#293600}
parent 279b9aad
......@@ -72,15 +72,18 @@ void ActivityFrameView::ResetWindowControls() {
}
void ActivityFrameView::UpdateWindowIcon() {
}
void ActivityFrameView::UpdateWindowTitle() {
if (!view_model_->UsesFrame())
return;
SkColor bgcolor = view_model_->GetRepresentativeColor();
title_->set_background(views::Background::CreateSolidBackground(bgcolor));
set_background(views::Background::CreateSolidBackground(bgcolor));
title_->SetBackgroundColor(bgcolor);
SchedulePaint();
}
void ActivityFrameView::UpdateWindowTitle() {
if (!view_model_->UsesFrame())
return;
title_->SetText(frame_->widget_delegate()->GetWindowTitle());
}
......
......@@ -74,8 +74,10 @@ class ActivityViewManagerImpl : public ActivityViewManager,
virtual void UpdateActivity(Activity* activity) OVERRIDE {
ActivityWidgetMap::iterator find = activity_widgets_.find(activity);
if (find != activity_widgets_.end())
if (find != activity_widgets_.end()) {
find->second->UpdateWindowIcon();
find->second->UpdateWindowTitle();
}
}
// views::WidgetObserver:
......
......@@ -477,6 +477,7 @@ void WebActivity::DidUpdateFaviconURL(
void WebActivity::DidChangeThemeColor(SkColor theme_color) {
title_color_ = theme_color;
ActivityManager::Get()->UpdateActivity(this);
}
void WebActivity::MakeVisible() {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment