OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "ash/wm/workspace/frame_maximize_button.h" | 5 #include "ash/wm/workspace/frame_maximize_button.h" |
6 | 6 |
7 #include "ash/launcher/launcher.h" | 7 #include "ash/launcher/launcher.h" |
8 #include "ash/screen_ash.h" | 8 #include "ash/screen_ash.h" |
9 #include "ash/shell.h" | 9 #include "ash/shell.h" |
10 #include "ash/wm/maximize_bubble_controller.h" | 10 #include "ash/wm/maximize_bubble_controller.h" |
(...skipping 399 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
410 SchedulePaint(); | 410 SchedulePaint(); |
411 | 411 |
412 if (snap_type_ == SNAP_NONE) { | 412 if (snap_type_ == SNAP_NONE) { |
413 phantom_window_.reset(); | 413 phantom_window_.reset(); |
414 return; | 414 return; |
415 } | 415 } |
416 | 416 |
417 if (snap_type_ == SNAP_LEFT || snap_type_ == SNAP_RIGHT) { | 417 if (snap_type_ == SNAP_LEFT || snap_type_ == SNAP_RIGHT) { |
418 SnapSizer::Edge snap_edge = snap_type_ == SNAP_LEFT ? | 418 SnapSizer::Edge snap_edge = snap_type_ == SNAP_LEFT ? |
419 SnapSizer::LEFT_EDGE : SnapSizer::RIGHT_EDGE; | 419 SnapSizer::LEFT_EDGE : SnapSizer::RIGHT_EDGE; |
420 int grid_size = Shell::GetInstance()->GetGridSize(); | |
421 snap_sizer_.reset(new SnapSizer(frame_->GetWidget()->GetNativeWindow(), | 420 snap_sizer_.reset(new SnapSizer(frame_->GetWidget()->GetNativeWindow(), |
422 LocationForSnapSizer(location), | 421 LocationForSnapSizer(location), |
423 snap_edge, grid_size)); | 422 snap_edge)); |
424 if (select_default) | 423 if (select_default) |
425 snap_sizer_->SelectDefaultSizeAndDisableResize(); | 424 snap_sizer_->SelectDefaultSizeAndDisableResize(); |
426 } | 425 } |
427 if (!phantom_window_.get()) { | 426 if (!phantom_window_.get()) { |
428 phantom_window_.reset(new internal::PhantomWindowController( | 427 phantom_window_.reset(new internal::PhantomWindowController( |
429 frame_->GetWidget()->GetNativeWindow())); | 428 frame_->GetWidget()->GetNativeWindow())); |
430 } | 429 } |
431 if (maximizer_.get()) { | 430 if (maximizer_.get()) { |
432 phantom_window_->set_phantom_below_window(maximizer_->GetBubbleWindow()); | 431 phantom_window_->set_phantom_below_window(maximizer_->GetBubbleWindow()); |
433 maximizer_->SetSnapType(snap_type_); | 432 maximizer_->SetSnapType(snap_type_); |
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
561 return FRAME_STATE_SNAP_LEFT; | 560 return FRAME_STATE_SNAP_LEFT; |
562 if (bounds.right() == screen.right()) | 561 if (bounds.right() == screen.right()) |
563 return FRAME_STATE_SNAP_RIGHT; | 562 return FRAME_STATE_SNAP_RIGHT; |
564 // If we come here, it is likely caused by the fact that the | 563 // If we come here, it is likely caused by the fact that the |
565 // "VerticalResizeDoubleClick" stored a restore rectangle. In that case | 564 // "VerticalResizeDoubleClick" stored a restore rectangle. In that case |
566 // we allow all maximize operations (and keep the restore rectangle). | 565 // we allow all maximize operations (and keep the restore rectangle). |
567 return FRAME_STATE_NONE; | 566 return FRAME_STATE_NONE; |
568 } | 567 } |
569 | 568 |
570 } // namespace ash | 569 } // namespace ash |
OLD | NEW |