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

Side by Side Diff: ash/wm/drag_window_resizer.cc

Issue 14297013: Cleanup: Remove unnecessary ".get()" from scoped_ptrs<>. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 8 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 | Annotate | Revision Log
« no previous file with comments | « ash/wm/custom_frame_view_ash_unittest.cc ('k') | ash/wm/event_rewriter_event_filter.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/drag_window_resizer.h" 5 #include "ash/wm/drag_window_resizer.h"
6 6
7 #include "ash/display/mouse_cursor_event_filter.h" 7 #include "ash/display/mouse_cursor_event_filter.h"
8 #include "ash/screen_ash.h" 8 #include "ash/screen_ash.h"
9 #include "ash/shell.h" 9 #include "ash/shell.h"
10 #include "ash/wm/coordinate_conversion.h" 10 #include "ash/wm/coordinate_conversion.h"
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after
157 const gfx::Rect root_bounds_in_screen(another_root->GetBoundsInScreen()); 157 const gfx::Rect root_bounds_in_screen(another_root->GetBoundsInScreen());
158 const gfx::Rect bounds_in_screen = 158 const gfx::Rect bounds_in_screen =
159 ScreenAsh::ConvertRectToScreen(GetTarget()->parent(), bounds); 159 ScreenAsh::ConvertRectToScreen(GetTarget()->parent(), bounds);
160 gfx::Rect bounds_in_another_root = 160 gfx::Rect bounds_in_another_root =
161 gfx::IntersectRects(root_bounds_in_screen, bounds_in_screen); 161 gfx::IntersectRects(root_bounds_in_screen, bounds_in_screen);
162 const float fraction_in_another_window = 162 const float fraction_in_another_window =
163 (bounds_in_another_root.width() * bounds_in_another_root.height()) / 163 (bounds_in_another_root.width() * bounds_in_another_root.height()) /
164 static_cast<float>(bounds.width() * bounds.height()); 164 static_cast<float>(bounds.width() * bounds.height());
165 165
166 if (fraction_in_another_window > 0) { 166 if (fraction_in_another_window > 0) {
167 if (!drag_window_controller_.get()) { 167 if (!drag_window_controller_) {
168 drag_window_controller_.reset( 168 drag_window_controller_.reset(
169 new DragWindowController(GetTarget())); 169 new DragWindowController(GetTarget()));
170 // Always show the drag phantom on the |another_root| window. 170 // Always show the drag phantom on the |another_root| window.
171 drag_window_controller_->SetDestinationDisplay( 171 drag_window_controller_->SetDestinationDisplay(
172 Shell::GetScreen()->GetDisplayMatching( 172 Shell::GetScreen()->GetDisplayMatching(
173 another_root->GetBoundsInScreen())); 173 another_root->GetBoundsInScreen()));
174 drag_window_controller_->Show(); 174 drag_window_controller_->Show();
175 } else { 175 } else {
176 // No animation. 176 // No animation.
177 drag_window_controller_->SetBounds(bounds_in_screen); 177 drag_window_controller_->SetBounds(bounds_in_screen);
(...skipping 12 matching lines...) Expand all
190 190
191 bool DragWindowResizer::ShouldAllowMouseWarp() { 191 bool DragWindowResizer::ShouldAllowMouseWarp() {
192 return (details_.window_component == HTCAPTION) && 192 return (details_.window_component == HTCAPTION) &&
193 !GetTarget()->transient_parent() && 193 !GetTarget()->transient_parent() &&
194 (GetTarget()->type() == aura::client::WINDOW_TYPE_NORMAL || 194 (GetTarget()->type() == aura::client::WINDOW_TYPE_NORMAL ||
195 GetTarget()->type() == aura::client::WINDOW_TYPE_PANEL); 195 GetTarget()->type() == aura::client::WINDOW_TYPE_PANEL);
196 } 196 }
197 197
198 } // namespace internal 198 } // namespace internal
199 } // namespace ash 199 } // namespace ash
OLDNEW
« no previous file with comments | « ash/wm/custom_frame_view_ash_unittest.cc ('k') | ash/wm/event_rewriter_event_filter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698