summaryrefslogtreecommitdiffstats
path: root/athena/content
diff options
context:
space:
mode:
authorsadrul@chromium.org <sadrul@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-08-08 20:02:11 +0000
committersadrul@chromium.org <sadrul@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-08-08 20:03:26 +0000
commit6e37c54119de89669bf3eca79132eb7424cea27b (patch)
tree875c8020aac73e58a005b054cb5dd2a70c4857b4 /athena/content
parent99122f042f54d56e952c4200f42f29768474bf7b (diff)
downloadchromium_src-6e37c54119de89669bf3eca79132eb7424cea27b.zip
chromium_src-6e37c54119de89669bf3eca79132eb7424cea27b.tar.gz
chromium_src-6e37c54119de89669bf3eca79132eb7424cea27b.tar.bz2
athena: Show the theme-color in the title strip, and fix the height.
If the web-page specifies a color using the 'theme-color' meta-tag, then use that color to paint the background of the window-title. Fix the height of the title to be 25px. BUG=401569 R=oshima@chromium.org Review URL: https://codereview.chromium.org/455773003 Cr-Commit-Position: refs/heads/master@{#288420} git-svn-id: svn://svn.chromium.org/chrome/trunk/src@288420 0039d316-1c4b-4281-b951-d872f2087c98
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_;