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

Unified Diff: athena/system/background_controller.cc

Issue 697143005: Fills athena background always. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 1 month 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
Index: athena/system/background_controller.cc
diff --git a/athena/system/background_controller.cc b/athena/system/background_controller.cc
index acfb2802a6eae1b3e4b462259a0944e6e90b673d..5d73a6c0327a7ccca9a0517ce2af995e7b93d8ec 100644
--- a/athena/system/background_controller.cc
+++ b/athena/system/background_controller.cc
@@ -5,6 +5,7 @@
#include "athena/system/background_controller.h"
#include "athena/system/public/system_ui.h"
+#include "athena/util/fill_layout_manager.h"
#include "ui/aura/window.h"
#include "ui/compositor/layer.h"
#include "ui/gfx/canvas.h"
@@ -58,9 +59,14 @@ BackgroundController::BackgroundController(aura::Window* background_container) {
views::Widget* background_widget = new views::Widget;
views::Widget::InitParams params(
views::Widget::InitParams::TYPE_WINDOW_FRAMELESS);
- params.parent = background_container;
background_widget->Init(params);
+ background_widget->GetNativeWindow()->SetProperty(kAlwaysFillWindowKey, true);
background_widget->GetNativeWindow()->layer()->SetMasksToBounds(true);
+ // background_widget should be reparented to |background_container| after
+ // settings kAlwaysFillWindowKey, otherwise FillLayoutManager cannot fill it
+ // properly.
+ views::Widget::ReparentNativeView(background_widget->GetNativeWindow(),
+ background_container);
background_view_ = new BackgroundView;
background_widget->SetContentsView(background_view_);
background_widget->GetNativeView()->SetName("BackgroundWidget");

Powered by Google App Engine
This is Rietveld 408576698