summaryrefslogtreecommitdiffstats
path: root/athena/content
diff options
context:
space:
mode:
Diffstat (limited to 'athena/content')
-rw-r--r--athena/content/web_activity.cc10
-rw-r--r--athena/content/web_activity.h2
2 files changed, 11 insertions, 1 deletions
diff --git a/athena/content/web_activity.cc b/athena/content/web_activity.cc
index 0a5e0b5..da1cfd5 100644
--- a/athena/content/web_activity.cc
+++ b/athena/content/web_activity.cc
@@ -120,6 +120,9 @@ class WebActivityController : public AcceleratorHandler {
DISALLOW_COPY_AND_ASSIGN(WebActivityController);
};
+const SkColor kDefaultTitleColor = SK_ColorGRAY;
+const SkColor kDefaultUnavailableColor = SkColorSetRGB(0xbb, 0x77, 0x77);
+
} // namespace
// A web view for athena's web activity. Note that AthenaWebView will create its
@@ -261,6 +264,7 @@ WebActivity::WebActivity(content::BrowserContext* browser_context,
: browser_context_(browser_context),
url_(url),
web_view_(NULL),
+ title_color_(kDefaultTitleColor),
current_state_(ACTIVITY_UNLOADED) {
}
@@ -349,7 +353,7 @@ void WebActivity::Init() {
SkColor WebActivity::GetRepresentativeColor() const {
// TODO(sad): Compute the color from the favicon.
- return web_view_ ? SK_ColorGRAY : SkColorSetRGB(0xbb, 0x77, 0x77);
+ return web_view_ ? title_color_ : kDefaultUnavailableColor;
}
base::string16 WebActivity::GetTitle() const {
@@ -389,4 +393,8 @@ void WebActivity::DidUpdateFaviconURL(
ActivityManager::Get()->UpdateActivity(this);
}
+void WebActivity::DidChangeThemeColor(SkColor theme_color) {
+ title_color_ = theme_color;
+}
+
} // namespace athena
diff --git a/athena/content/web_activity.h b/athena/content/web_activity.h
index 45407a4..6e3f41b 100644
--- a/athena/content/web_activity.h
+++ b/athena/content/web_activity.h
@@ -54,11 +54,13 @@ class WebActivity : public Activity,
bool explicit_set) OVERRIDE;
virtual void DidUpdateFaviconURL(
const std::vector<content::FaviconURL>& candidates) OVERRIDE;
+ virtual void DidChangeThemeColor(SkColor theme_color) OVERRIDE;
private:
content::BrowserContext* browser_context_;
const GURL url_;
AthenaWebView* web_view_;
+ SkColor title_color_;
// The current state for this activity.
ActivityState current_state_;