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

Unified Diff: ash/wm/dock/docked_window_resizer.cc

Issue 24108003: [Cleanup] Rename WindowSettings to WindowState (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase fix Created 7 years, 3 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/dock/docked_window_layout_manager_unittest.cc ('k') | ash/wm/dock/docked_window_resizer_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/wm/dock/docked_window_resizer.cc
diff --git a/ash/wm/dock/docked_window_resizer.cc b/ash/wm/dock/docked_window_resizer.cc
index e16895598dcc8d2de44ee621c3b2e01d17a6ed65..2882f3b2193631633b002b59a661a0981a797761 100644
--- a/ash/wm/dock/docked_window_resizer.cc
+++ b/ash/wm/dock/docked_window_resizer.cc
@@ -15,8 +15,7 @@
#include "ash/shell_window_ids.h"
#include "ash/wm/coordinate_conversion.h"
#include "ash/wm/dock/docked_window_layout_manager.h"
-#include "ash/wm/property_util.h"
-#include "ash/wm/window_settings.h"
+#include "ash/wm/window_state.h"
#include "ash/wm/workspace/magnetism_matcher.h"
#include "ash/wm/workspace/workspace_window_resizer.h"
#include "base/command_line.h"
@@ -80,10 +79,10 @@ void DockedWindowResizer::Drag(const gfx::Point& location, int event_flags) {
// Temporarily clear kWindowTrackedByWorkspaceKey for windows that are snapped
// to screen edges e.g. when they are docked. This prevents the windows from
// getting snapped to other nearby windows during the drag.
- wm::WindowSettings* window_settings = wm::GetWindowSettings(GetTarget());
- bool was_tracked_by_workspace = window_settings->tracked_by_workspace();
+ wm::WindowState* window_state = wm::GetWindowState(GetTarget());
+ bool was_tracked_by_workspace = window_state->tracked_by_workspace();
if (set_tracked_by_workspace)
- window_settings->SetTrackedByWorkspace(false);
+ window_state->SetTrackedByWorkspace(false);
gfx::Point modified_location(location.x() + offset.x(),
location.y() + offset.y());
@@ -91,7 +90,7 @@ void DockedWindowResizer::Drag(const gfx::Point& location, int event_flags) {
next_window_resizer_->Drag(modified_location, event_flags);
if (!resizer)
return;
- window_settings->SetTrackedByWorkspace(was_tracked_by_workspace);
+ window_state->SetTrackedByWorkspace(was_tracked_by_workspace);
DockedWindowLayoutManager* new_dock_layout =
GetDockedLayoutManagerAtPoint(last_location_);
@@ -121,24 +120,24 @@ void DockedWindowResizer::CompleteDrag(int event_flags) {
// Temporarily clear kWindowTrackedByWorkspaceKey for panels so that they
// don't get forced into the workspace that may be shrunken because of docked
// windows.
- wm::WindowSettings* window_settings = wm::GetWindowSettings(GetTarget());
- bool was_tracked_by_workspace = window_settings->tracked_by_workspace();
+ wm::WindowState* window_state = wm::GetWindowState(GetTarget());
+ bool was_tracked_by_workspace = window_state->tracked_by_workspace();
if (was_docked_)
- window_settings->SetTrackedByWorkspace(false);
+ window_state->SetTrackedByWorkspace(false);
// The root window can change when dragging into a different screen.
next_window_resizer_->CompleteDrag(event_flags);
FinishedDragging();
- window_settings->SetTrackedByWorkspace(was_tracked_by_workspace);
+ window_state->SetTrackedByWorkspace(was_tracked_by_workspace);
}
void DockedWindowResizer::RevertDrag() {
// Temporarily clear kWindowTrackedByWorkspaceKey for panels so that they
// don't get forced into the workspace that may be shrunken because of docked
// windows.
- wm::WindowSettings* window_settings = wm::GetWindowSettings(GetTarget());
- bool was_tracked_by_workspace = window_settings->tracked_by_workspace();
+ wm::WindowState* window_state = wm::GetWindowState(GetTarget());
+ bool was_tracked_by_workspace = window_state->tracked_by_workspace();
if (was_docked_)
- window_settings->SetTrackedByWorkspace(false);
+ window_state->SetTrackedByWorkspace(false);
next_window_resizer_->RevertDrag();
// Restore docked state to what it was before the drag if necessary.
if (was_docked_ && !is_docked_) {
@@ -146,7 +145,7 @@ void DockedWindowResizer::RevertDrag() {
is_docked_ = was_docked_;
}
FinishedDragging();
- window_settings->SetTrackedByWorkspace(was_tracked_by_workspace);
+ window_state->SetTrackedByWorkspace(was_tracked_by_workspace);
}
aura::Window* DockedWindowResizer::GetTarget() {
@@ -227,7 +226,7 @@ void DockedWindowResizer::StartedDragging() {
if (GetTarget()->type() != aura::client::WINDOW_TYPE_PANEL &&
GetTarget()->parent()->id() == kShellWindowId_DefaultContainer) {
// The window is going to be reparented - avoid completing the drag.
- wm::GetWindowSettings(GetTarget())->set_continue_drag_after_reparent(true);
+ wm::GetWindowState(GetTarget())->set_continue_drag_after_reparent(true);
// Reparent the window into the docked windows container in order to get it
// on top of other docked windows.
@@ -243,16 +242,16 @@ void DockedWindowResizer::StartedDragging() {
void DockedWindowResizer::FinishedDragging() {
if (!did_move_or_resize_)
return;
-
aura::Window* window = GetTarget();
+ wm::WindowState* window_state = wm::GetWindowState(window);
const bool attached_panel =
window->type() == aura::client::WINDOW_TYPE_PANEL &&
- wm::GetWindowSettings(window)->panel_attached();
+ window_state->panel_attached();
const bool is_resized =
(details_.bounds_change & WindowResizer::kBoundsChange_Resizes) != 0;
// No longer restore to pre-docked bounds if a window has been resized.
if (is_resized && is_docked_)
- ClearRestoreBounds(window);
+ window_state->ClearRestoreBounds();
// Check if the window needs to be docked or returned to workspace.
aura::Window* dock_container = Shell::GetContainer(
« no previous file with comments | « ash/wm/dock/docked_window_layout_manager_unittest.cc ('k') | ash/wm/dock/docked_window_resizer_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698