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

Unified Diff: ash/shelf/shelf_widget.cc

Issue 2201323004: mash: Use wm::WmSnapToPixelLayoutManager for the shelf. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Also convert the StatusAreaLayoutManager. Created 4 years, 4 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 | « ash/shelf/shelf_layout_manager.cc ('k') | ash/wm/status_area_layout_manager.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/shelf/shelf_widget.cc
diff --git a/ash/shelf/shelf_widget.cc b/ash/shelf/shelf_widget.cc
index 4a9d08fb7ec44542f2d1c565ffa198a2a06daa7b..d57e62ca339e3f9eb42389a5499e91730425aeee 100644
--- a/ash/shelf/shelf_widget.cc
+++ b/ash/shelf/shelf_widget.cc
@@ -24,6 +24,7 @@
#include "ash/shell.h"
#include "ash/wm/status_area_layout_manager.h"
#include "ash/wm/workspace_controller.h"
+#include "base/memory/ptr_util.h"
#include "grit/ash_resources.h"
#include "ui/aura/window.h"
#include "ui/base/resource/resource_bundle.h"
@@ -364,9 +365,7 @@ ShelfWidget::ShelfWidget(WmWindow* wm_shelf_container,
shelf_layout_manager_ = new ShelfLayoutManager(this);
shelf_layout_manager_->AddObserver(this);
- aura::Window* shelf_container =
- WmWindowAura::GetAuraWindow(wm_shelf_container);
- shelf_container->SetLayoutManager(shelf_layout_manager_);
+ wm_shelf_container->SetLayoutManager(base::WrapUnique(shelf_layout_manager_));
shelf_layout_manager_->set_workspace_controller(workspace_controller);
workspace_controller->SetShelf(shelf_layout_manager_);
background_animator_.PaintBackground(
@@ -382,12 +381,13 @@ ShelfWidget::ShelfWidget(WmWindow* wm_shelf_container,
status_area_widget_->Show();
WmShell::Get()->focus_cycler()->AddWidget(status_area_widget_);
background_animator_.AddObserver(status_area_widget_);
+ wm_status_container->SetLayoutManager(
+ base::MakeUnique<StatusAreaLayoutManager>(this));
+ aura::Window* shelf_container =
+ WmWindowAura::GetAuraWindow(wm_shelf_container);
aura::Window* status_container =
WmWindowAura::GetAuraWindow(wm_status_container);
- status_container->SetLayoutManager(
- new StatusAreaLayoutManager(status_container, this));
-
shelf_container->SetEventTargeter(std::unique_ptr<ui::EventTargeter>(
new ShelfWindowTargeter(shelf_container, shelf_layout_manager_)));
status_container->SetEventTargeter(std::unique_ptr<ui::EventTargeter>(
« no previous file with comments | « ash/shelf/shelf_layout_manager.cc ('k') | ash/wm/status_area_layout_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698