Chromium Code Reviews| 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..f9a84d0a1f24f93c319b636d123214e4c5171d5f 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,18 +98,18 @@ void ActivityFrameView::ResetWindowControls() { |
| } |
| void ActivityFrameView::UpdateWindowIcon() { |
| - if (!view_model_->UsesFrame()) |
| - return; |
| + icon_->SetImage(view_model_->GetIcon()); |
| +} |
| +void ActivityFrameView::UpdateWindowTitle() { |
| + // 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); |
| - SchedulePaint(); |
|
sadrul
2014/09/07 05:39:18
You need to keep this here. See https://codereview
pkotwicz
2014/09/08 21:36:17
You're right. Thanks for catching this!
|
| -} |
| -void ActivityFrameView::UpdateWindowTitle() { |
| if (!view_model_->UsesFrame()) |
| return; |
| + title_->SetBackgroundColor(bgcolor); |
| title_->SetText(frame_->widget_delegate()->GetWindowTitle()); |
| Layout(); |
| } |