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/wm/caption_buttons/alternate_frame_size_button.h" | 5 #include "ash/wm/caption_buttons/alternate_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_ash.h" | 8 #include "ash/screen_util.h" |
9 #include "ash/shell.h" | 9 #include "ash/shell.h" |
10 #include "ash/touch/touch_uma.h" | 10 #include "ash/touch/touch_uma.h" |
11 #include "ash/wm/window_state.h" | 11 #include "ash/wm/window_state.h" |
12 #include "ash/wm/workspace/phantom_window_controller.h" | 12 #include "ash/wm/workspace/phantom_window_controller.h" |
13 #include "ash/wm/workspace/snap_sizer.h" | 13 #include "ash/wm/workspace/snap_sizer.h" |
14 #include "ui/gfx/vector2d.h" | 14 #include "ui/gfx/vector2d.h" |
15 #include "ui/views/widget/widget.h" | 15 #include "ui/views/widget/widget.h" |
16 | 16 |
17 namespace { | 17 namespace { |
18 | 18 |
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
184 phantom_window_controller_.reset( | 184 phantom_window_controller_.reset( |
185 new internal::PhantomWindowController(frame_->GetNativeWindow())); | 185 new internal::PhantomWindowController(frame_->GetNativeWindow())); |
186 } | 186 } |
187 | 187 |
188 using internal::SnapSizer; | 188 using internal::SnapSizer; |
189 SnapSizer snap_sizer(wm::GetWindowState(frame_->GetNativeWindow()), | 189 SnapSizer snap_sizer(wm::GetWindowState(frame_->GetNativeWindow()), |
190 gfx::Point(), | 190 gfx::Point(), |
191 snap_type_ == SNAP_LEFT ? | 191 snap_type_ == SNAP_LEFT ? |
192 SnapSizer::LEFT_EDGE : SnapSizer::RIGHT_EDGE, | 192 SnapSizer::LEFT_EDGE : SnapSizer::RIGHT_EDGE, |
193 SnapSizer::OTHER_INPUT); | 193 SnapSizer::OTHER_INPUT); |
194 phantom_window_controller_->Show(ScreenAsh::ConvertRectToScreen( | 194 phantom_window_controller_->Show(ScreenUtil::ConvertRectToScreen( |
195 frame_->GetNativeView()->parent(), | 195 frame_->GetNativeView()->parent(), |
196 snap_sizer.target_bounds())); | 196 snap_sizer.target_bounds())); |
197 } else { | 197 } else { |
198 phantom_window_controller_.reset(); | 198 phantom_window_controller_.reset(); |
199 } | 199 } |
200 } | 200 } |
201 | 201 |
202 bool AlternateFrameSizeButton::CommitSnap(const ui::LocatedEvent& event) { | 202 bool AlternateFrameSizeButton::CommitSnap(const ui::LocatedEvent& event) { |
203 // The position of |event| may be different than the position of the previous | 203 // The position of |event| may be different than the position of the previous |
204 // event. | 204 // event. |
(...skipping 19 matching lines...) Expand all Loading... |
224 void AlternateFrameSizeButton::SetButtonsToNormalMode( | 224 void AlternateFrameSizeButton::SetButtonsToNormalMode( |
225 AlternateFrameSizeButtonDelegate::Animate animate) { | 225 AlternateFrameSizeButtonDelegate::Animate animate) { |
226 in_snap_mode_ = false; | 226 in_snap_mode_ = false; |
227 snap_type_ = SNAP_NONE; | 227 snap_type_ = SNAP_NONE; |
228 set_buttons_to_snap_mode_timer_.Stop(); | 228 set_buttons_to_snap_mode_timer_.Stop(); |
229 delegate_->SetButtonsToNormal(animate); | 229 delegate_->SetButtonsToNormal(animate); |
230 phantom_window_controller_.reset(); | 230 phantom_window_controller_.reset(); |
231 } | 231 } |
232 | 232 |
233 } // namespace ash | 233 } // namespace ash |
OLD | NEW |