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

Unified Diff: ash/wm/panels/panel_window_resizer.cc

Issue 13896026: Stick windows to sides of workspaces (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Dock with zero width (comments on unit tests) Created 7 years, 6 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
Index: ash/wm/panels/panel_window_resizer.cc
diff --git a/ash/wm/panels/panel_window_resizer.cc b/ash/wm/panels/panel_window_resizer.cc
index 947cf90931b0cbbbd2a814f8f926d56bf4329b47..72dd7bd8d7b3e409892bb2cebfa8f3e6a7496b86 100644
--- a/ash/wm/panels/panel_window_resizer.cc
+++ b/ash/wm/panels/panel_window_resizer.cc
@@ -6,7 +6,6 @@
#include "ash/display/display_controller.h"
#include "ash/launcher/launcher.h"
-#include "ash/root_window_controller.h"
#include "ash/screen_ash.h"
#include "ash/shelf/shelf_types.h"
#include "ash/shelf/shelf_widget.h"
@@ -57,6 +56,8 @@ PanelWindowResizer::Create(WindowResizer* next_window_resizer,
}
void PanelWindowResizer::Drag(const gfx::Point& location, int event_flags) {
+ last_location_ = location;
+ wm::ConvertPointToScreen(GetTarget()->parent(), &last_location_);
bool destroyed = false;
if (!did_move_or_resize_) {
did_move_or_resize_ = true;
@@ -124,6 +125,10 @@ aura::Window* PanelWindowResizer::GetTarget() {
return next_window_resizer_->GetTarget();
}
+const gfx::Point& PanelWindowResizer::GetInitialLocationForTest() const {
+ return details_.initial_location_in_parent;
+}
+
PanelWindowResizer::PanelWindowResizer(WindowResizer* next_window_resizer,
const Details& details)
: details_(details),
@@ -204,9 +209,9 @@ void PanelWindowResizer::FinishDragging() {
if (GetTarget()->GetProperty(internal::kPanelAttachedKey) !=
should_attach_) {
GetTarget()->SetProperty(internal::kPanelAttachedKey, should_attach_);
- GetTarget()->SetDefaultParentByRootWindow(
- GetTarget()->GetRootWindow(),
- GetTarget()->GetBoundsInScreen());
+ gfx::Rect near_last_location(last_location_, gfx::Size());
+ GetTarget()->SetDefaultParentByRootWindow(GetTarget()->GetRootWindow(),
+ near_last_location);
}
if (panel_container_)
GetPanelLayoutManager(panel_container_)->FinishDragging();

Powered by Google App Engine
This is Rietveld 408576698