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

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 (rebase) 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
« no previous file with comments | « ash/wm/panels/panel_window_resizer.h ('k') | ash/wm/panels/panel_window_resizer_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 8c35abcc82ba36f8108460f103923b2c0ac13405..1c054b4c36f20c00128ae0d763a53588d1e62589 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"
@@ -58,6 +57,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;
@@ -125,6 +126,10 @@ aura::Window* PanelWindowResizer::GetTarget() {
return next_window_resizer_->GetTarget();
}
+const gfx::Point& PanelWindowResizer::GetInitialLocation() const {
+ return details_.initial_location_in_parent;
+}
+
PanelWindowResizer::PanelWindowResizer(WindowResizer* next_window_resizer,
const Details& details)
: details_(details),
@@ -205,9 +210,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();
« no previous file with comments | « ash/wm/panels/panel_window_resizer.h ('k') | ash/wm/panels/panel_window_resizer_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698