Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(743)

Side by Side Diff: ash/frame/caption_buttons/frame_size_button.cc

Issue 2905893002: chromeos: convert more ash/wm code to aura::Window (Closed)
Patch Set: moar cleanup Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | ash/mus/move_event_handler.h » ('j') | ash/wm/wm_toplevel_window_event_handler.cc » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « no previous file | ash/mus/move_event_handler.h » ('j') | ash/wm/wm_toplevel_window_event_handler.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698