| 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/shell_port.h" | 7 #include "ash/shell_port.h" |
| 8 #include "ash/wm/window_positioning_utils.h" | 8 #include "ash/wm/window_positioning_utils.h" |
| 9 #include "ash/wm/window_state.h" | 9 #include "ash/wm/window_state.h" |
| 10 #include "ash/wm/wm_event.h" | 10 #include "ash/wm/wm_event.h" |
| (...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 206 case CAPTION_BUTTON_ICON_LOCATION: | 206 case CAPTION_BUTTON_ICON_LOCATION: |
| 207 case CAPTION_BUTTON_ICON_COUNT: | 207 case CAPTION_BUTTON_ICON_COUNT: |
| 208 NOTREACHED(); | 208 NOTREACHED(); |
| 209 break; | 209 break; |
| 210 } | 210 } |
| 211 } | 211 } |
| 212 | 212 |
| 213 if (snap_type_ == SNAP_LEFT || snap_type_ == SNAP_RIGHT) { | 213 if (snap_type_ == SNAP_LEFT || snap_type_ == SNAP_RIGHT) { |
| 214 aura::Window* window = frame_->GetNativeWindow(); | 214 aura::Window* window = frame_->GetNativeWindow(); |
| 215 if (!phantom_window_controller_.get()) { | 215 if (!phantom_window_controller_.get()) { |
| 216 phantom_window_controller_.reset(new PhantomWindowController(window)); | 216 phantom_window_controller_ = |
| 217 base::MakeUnique<PhantomWindowController>(window); |
| 217 } | 218 } |
| 218 gfx::Rect phantom_bounds_in_screen = | 219 gfx::Rect phantom_bounds_in_screen = |
| 219 (snap_type_ == SNAP_LEFT) | 220 (snap_type_ == SNAP_LEFT) |
| 220 ? wm::GetDefaultLeftSnappedWindowBoundsInParent(window) | 221 ? wm::GetDefaultLeftSnappedWindowBoundsInParent(window) |
| 221 : wm::GetDefaultRightSnappedWindowBoundsInParent(window); | 222 : wm::GetDefaultRightSnappedWindowBoundsInParent(window); |
| 222 ::wm::ConvertRectToScreen(window->parent(), &phantom_bounds_in_screen); | 223 ::wm::ConvertRectToScreen(window->parent(), &phantom_bounds_in_screen); |
| 223 phantom_window_controller_->Show(phantom_bounds_in_screen); | 224 phantom_window_controller_->Show(phantom_bounds_in_screen); |
| 224 } else { | 225 } else { |
| 225 phantom_window_controller_.reset(); | 226 phantom_window_controller_.reset(); |
| 226 } | 227 } |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 263 void FrameSizeButton::SetButtonsToNormalMode( | 264 void FrameSizeButton::SetButtonsToNormalMode( |
| 264 FrameSizeButtonDelegate::Animate animate) { | 265 FrameSizeButtonDelegate::Animate animate) { |
| 265 in_snap_mode_ = false; | 266 in_snap_mode_ = false; |
| 266 snap_type_ = SNAP_NONE; | 267 snap_type_ = SNAP_NONE; |
| 267 set_buttons_to_snap_mode_timer_.Stop(); | 268 set_buttons_to_snap_mode_timer_.Stop(); |
| 268 delegate_->SetButtonsToNormal(animate); | 269 delegate_->SetButtonsToNormal(animate); |
| 269 phantom_window_controller_.reset(); | 270 phantom_window_controller_.reset(); |
| 270 } | 271 } |
| 271 | 272 |
| 272 } // namespace ash | 273 } // namespace ash |
| OLD | NEW |