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

Unified Diff: ash/root_window_controller.cc

Issue 2222093003: ash: Move ShelfWindowTargeter construction from ShelfWidget to RootWindowController (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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 | « no previous file | ash/shelf/shelf_widget.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/root_window_controller.cc
diff --git a/ash/root_window_controller.cc b/ash/root_window_controller.cc
index 6cdc05c513ec693cd05db7e1df7a880752905850..2fee93a9e8672d61d157494f0b2e903a3e9747f9 100644
--- a/ash/root_window_controller.cc
+++ b/ash/root_window_controller.cc
@@ -42,6 +42,7 @@
#include "ash/shelf/shelf.h"
#include "ash/shelf/shelf_layout_manager.h"
#include "ash/shelf/shelf_widget.h"
+#include "ash/shelf/shelf_window_targeter.h"
#include "ash/shell.h"
#include "ash/touch/touch_hud_debug.h"
#include "ash/touch/touch_hud_projection.h"
@@ -851,14 +852,22 @@ void RootWindowController::InitLayoutManagers() {
always_on_top_controller_.reset(
new AlwaysOnTopController(always_on_top_container));
+ // Create the shelf and status area widgets.
DCHECK(!shelf_widget_.get());
- WmWindow* shelf_container =
- WmWindowAura::Get(GetContainer(kShellWindowId_ShelfContainer));
- WmWindow* status_container =
- WmWindowAura::Get(GetContainer(kShellWindowId_StatusContainer));
- shelf_widget_.reset(new ShelfWidget(shelf_container, status_container,
+ aura::Window* shelf_container = GetContainer(kShellWindowId_ShelfContainer);
+ aura::Window* status_container = GetContainer(kShellWindowId_StatusContainer);
+ WmWindow* wm_shelf_container = WmWindowAura::Get(shelf_container);
+ WmWindow* wm_status_container = WmWindowAura::Get(status_container);
+ shelf_widget_.reset(new ShelfWidget(wm_shelf_container, wm_status_container,
wm_shelf_aura_.get(),
workspace_controller()));
+ // Make it easier to resize windows that partially overlap the shelf. Must
+ // occur after the ShelfLayoutManager is constructed by ShelfWidget.
+ shelf_container->SetEventTargeter(base::MakeUnique<ShelfWindowTargeter>(
+ wm_shelf_container, wm_shelf_aura_.get()));
+ status_container->SetEventTargeter(base::MakeUnique<ShelfWindowTargeter>(
+ wm_status_container, wm_shelf_aura_.get()));
+
workspace_layout_manager_delegate->set_shelf(
shelf_widget_->shelf_layout_manager());
« no previous file with comments | « no previous file | ash/shelf/shelf_widget.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698