OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/frame/caption_buttons/frame_maximize_button.h" | 5 #include "ash/frame/caption_buttons/frame_maximize_button.h" |
6 | 6 |
7 #include "ash/frame/caption_buttons/frame_maximize_button_observer.h" | 7 #include "ash/frame/caption_buttons/frame_maximize_button_observer.h" |
8 #include "ash/frame/caption_buttons/maximize_bubble_controller.h" | 8 #include "ash/frame/caption_buttons/maximize_bubble_controller.h" |
9 #include "ash/metrics/user_metrics_recorder.h" | 9 #include "ash/metrics/user_metrics_recorder.h" |
10 #include "ash/screen_util.h" | 10 #include "ash/screen_util.h" |
(...skipping 396 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
407 snap_type_ = type; | 407 snap_type_ = type; |
408 SchedulePaint(); | 408 SchedulePaint(); |
409 | 409 |
410 if (snap_type_ == SNAP_NONE) { | 410 if (snap_type_ == SNAP_NONE) { |
411 phantom_window_.reset(); | 411 phantom_window_.reset(); |
412 return; | 412 return; |
413 } | 413 } |
414 | 414 |
415 if (!phantom_window_) { | 415 if (!phantom_window_) { |
416 phantom_window_.reset( | 416 phantom_window_.reset( |
417 new internal::PhantomWindowController(frame_->GetNativeWindow())); | 417 new PhantomWindowController(frame_->GetNativeWindow())); |
418 } | 418 } |
419 if (maximizer_) { | 419 if (maximizer_) { |
420 phantom_window_->set_phantom_below_window(maximizer_->GetBubbleWindow()); | 420 phantom_window_->set_phantom_below_window(maximizer_->GetBubbleWindow()); |
421 maximizer_->SetSnapType(snap_type_); | 421 maximizer_->SetSnapType(snap_type_); |
422 } | 422 } |
423 phantom_window_->Show(ScreenBoundsForType(snap_type_)); | 423 phantom_window_->Show(ScreenBoundsForType(snap_type_)); |
424 } | 424 } |
425 | 425 |
426 SnapType FrameMaximizeButton::SnapTypeForLocation( | 426 SnapType FrameMaximizeButton::SnapTypeForLocation( |
427 const gfx::Point& location) const { | 427 const gfx::Point& location) const { |
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
538 return FRAME_STATE_SNAP_LEFT; | 538 return FRAME_STATE_SNAP_LEFT; |
539 if (bounds.right() == screen.right()) | 539 if (bounds.right() == screen.right()) |
540 return FRAME_STATE_SNAP_RIGHT; | 540 return FRAME_STATE_SNAP_RIGHT; |
541 // If we come here, it is likely caused by the fact that the | 541 // If we come here, it is likely caused by the fact that the |
542 // "VerticalResizeDoubleClick" stored a restore rectangle. In that case | 542 // "VerticalResizeDoubleClick" stored a restore rectangle. In that case |
543 // we allow all maximize operations (and keep the restore rectangle). | 543 // we allow all maximize operations (and keep the restore rectangle). |
544 return FRAME_STATE_NONE; | 544 return FRAME_STATE_NONE; |
545 } | 545 } |
546 | 546 |
547 } // namespace ash | 547 } // namespace ash |
OLD | NEW |