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

Unified Diff: athena/activity/activity_frame_view.cc

Issue 550643002: [Athena] Hack to display favicons for web activities in overview mode (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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | athena/activity/activity_view_manager_impl.cc » ('j') | athena/content/web_activity.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: athena/activity/activity_frame_view.cc
diff --git a/athena/activity/activity_frame_view.cc b/athena/activity/activity_frame_view.cc
index e4ff4131d10947bde6ce12b2aa45de76fbfe4b90..ed182558843d01b943add9d30e3452a59c117301 100644
--- a/athena/activity/activity_frame_view.cc
+++ b/athena/activity/activity_frame_view.cc
@@ -6,7 +6,6 @@
#include "athena/activity/public/activity_view_model.h"
#include "athena/wm/public/window_manager.h"
-#include "third_party/skia/include/core/SkBitmap.h"
#include "ui/base/hit_test.h"
#include "ui/gfx/canvas.h"
#include "ui/gfx/image/image_skia.h"
@@ -25,7 +24,7 @@ namespace {
const int kIconSize = 32;
// The distance between the icon and the title when the icon is visible.
-const int kIconTitleSpacing = 5;
+const int kIconTitleSpacing = 10;
// The height of the top border necessary to display the title without the icon.
const int kDefaultTitleHeight = 25;
@@ -54,17 +53,11 @@ ActivityFrameView::ActivityFrameView(views::Widget* frame,
in_overview_(false) {
title_->SetEnabledColor(SkColorSetA(SK_ColorBLACK, 0xe5));
- SkBitmap bitmap;
- bitmap.allocN32Pixels(kIconSize, kIconSize);
- bitmap.eraseARGB(255, 0, 255, 0);
- icon_->SetImage(gfx::ImageSkia::CreateFrom1xBitmap(bitmap));
-
AddChildView(title_);
AddChildView(icon_);
- SkColor bgcolor = view_model_->GetRepresentativeColor();
- set_background(views::Background::CreateSolidBackground(bgcolor));
UpdateWindowTitle();
+ UpdateWindowIcon();
WindowManager::GetInstance()->AddObserver(this);
}
@@ -105,12 +98,13 @@ void ActivityFrameView::ResetWindowControls() {
}
void ActivityFrameView::UpdateWindowIcon() {
- if (!view_model_->UsesFrame())
- return;
-
+ // The activity has a frame in overview mode regardless of the value of
+ // ActivityViewModel::UsesFrame().
SkColor bgcolor = view_model_->GetRepresentativeColor();
set_background(views::Background::CreateSolidBackground(bgcolor));
- title_->SetBackgroundColor(bgcolor);
+
+ if (view_model_->UsesFrame())
+ icon_->SetImage(view_model_->GetIcon());
SchedulePaint();
}
« no previous file with comments | « no previous file | athena/activity/activity_view_manager_impl.cc » ('j') | athena/content/web_activity.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698