| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_size_button.h" | 5 #include "ash/frame/caption_buttons/frame_size_button.h" |
| 6 | 6 |
| 7 #include "ash/metrics/user_metrics_recorder.h" | 7 #include "ash/metrics/user_metrics_recorder.h" |
| 8 #include "ash/screen_util.h" | 8 #include "ash/screen_util.h" |
| 9 #include "ash/shell.h" | 9 #include "ash/shell.h" |
| 10 #include "ash/wm/aura/wm_window_aura.h" | 10 #include "ash/wm/aura/wm_window_aura.h" |
| (...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 216 case CAPTION_BUTTON_ICON_LOCATION: | 216 case CAPTION_BUTTON_ICON_LOCATION: |
| 217 case CAPTION_BUTTON_ICON_COUNT: | 217 case CAPTION_BUTTON_ICON_COUNT: |
| 218 NOTREACHED(); | 218 NOTREACHED(); |
| 219 break; | 219 break; |
| 220 } | 220 } |
| 221 } | 221 } |
| 222 | 222 |
| 223 if (snap_type_ == SNAP_LEFT || snap_type_ == SNAP_RIGHT) { | 223 if (snap_type_ == SNAP_LEFT || snap_type_ == SNAP_RIGHT) { |
| 224 aura::Window* window = frame_->GetNativeWindow(); | 224 aura::Window* window = frame_->GetNativeWindow(); |
| 225 if (!phantom_window_controller_.get()) { | 225 if (!phantom_window_controller_.get()) { |
| 226 phantom_window_controller_.reset(new PhantomWindowController(window)); | 226 phantom_window_controller_.reset( |
| 227 new PhantomWindowController(wm::WmWindowAura::Get(window))); |
| 227 } | 228 } |
| 228 gfx::Rect phantom_bounds_in_parent = | 229 gfx::Rect phantom_bounds_in_parent = |
| 229 (snap_type_ == SNAP_LEFT) | 230 (snap_type_ == SNAP_LEFT) |
| 230 ? wm::GetDefaultLeftSnappedWindowBoundsInParent( | 231 ? wm::GetDefaultLeftSnappedWindowBoundsInParent( |
| 231 wm::WmWindowAura::Get(window)) | 232 wm::WmWindowAura::Get(window)) |
| 232 : wm::GetDefaultRightSnappedWindowBoundsInParent( | 233 : wm::GetDefaultRightSnappedWindowBoundsInParent( |
| 233 wm::WmWindowAura::Get(window)); | 234 wm::WmWindowAura::Get(window)); |
| 234 phantom_window_controller_->Show(ScreenUtil::ConvertRectToScreen( | 235 phantom_window_controller_->Show(ScreenUtil::ConvertRectToScreen( |
| 235 window->parent(), phantom_bounds_in_parent)); | 236 window->parent(), phantom_bounds_in_parent)); |
| 236 } else { | 237 } else { |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 278 void FrameSizeButton::SetButtonsToNormalMode( | 279 void FrameSizeButton::SetButtonsToNormalMode( |
| 279 FrameSizeButtonDelegate::Animate animate) { | 280 FrameSizeButtonDelegate::Animate animate) { |
| 280 in_snap_mode_ = false; | 281 in_snap_mode_ = false; |
| 281 snap_type_ = SNAP_NONE; | 282 snap_type_ = SNAP_NONE; |
| 282 set_buttons_to_snap_mode_timer_.Stop(); | 283 set_buttons_to_snap_mode_timer_.Stop(); |
| 283 delegate_->SetButtonsToNormal(animate); | 284 delegate_->SetButtonsToNormal(animate); |
| 284 phantom_window_controller_.reset(); | 285 phantom_window_controller_.reset(); |
| 285 } | 286 } |
| 286 | 287 |
| 287 } // namespace ash | 288 } // namespace ash |
| OLD | NEW |