summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSadrul Habib Chowdhury <sadrul@chromium.org>2014-09-05 21:19:39 -0400
committerSadrul Habib Chowdhury <sadrul@chromium.org>2014-09-06 01:21:18 +0000
commite5d4ccbd978334a428653cace202f5cc963fffb6 (patch)
treec9362f75c0d52b688e53c6de9d2d3966316439d5
parent279b9aad9824c840e10382c2f6e4356d4c632774 (diff)
downloadchromium_src-e5d4ccbd978334a428653cace202f5cc963fffb6.zip
chromium_src-e5d4ccbd978334a428653cace202f5cc963fffb6.tar.gz
chromium_src-e5d4ccbd978334a428653cace202f5cc963fffb6.tar.bz2
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}
-rw-r--r--athena/activity/activity_frame_view.cc11
-rw-r--r--athena/activity/activity_view_manager_impl.cc4
-rw-r--r--athena/content/web_activity.cc1
3 files changed, 11 insertions, 5 deletions
diff --git a/athena/activity/activity_frame_view.cc b/athena/activity/activity_frame_view.cc
index 08aeb3d..83b9388 100644
--- a/athena/activity/activity_frame_view.cc
+++ b/athena/activity/activity_frame_view.cc
@@ -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());
}
diff --git a/athena/activity/activity_view_manager_impl.cc b/athena/activity/activity_view_manager_impl.cc
index 7f6eed8..76d40d4 100644
--- a/athena/activity/activity_view_manager_impl.cc
+++ b/athena/activity/activity_view_manager_impl.cc
@@ -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:
diff --git a/athena/content/web_activity.cc b/athena/content/web_activity.cc
index 4dca1c3..34a21d0 100644
--- a/athena/content/web_activity.cc
+++ b/athena/content/web_activity.cc
@@ -477,6 +477,7 @@ void WebActivity::DidUpdateFaviconURL(
void WebActivity::DidChangeThemeColor(SkColor theme_color) {
title_color_ = theme_color;
+ ActivityManager::Get()->UpdateActivity(this);
}
void WebActivity::MakeVisible() {