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

Side by Side Diff: ash/wm/workspace/phantom_window_controller.cc

Issue 10795013: Rename bounds accessors to be intuitive and consistent (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 8 years, 5 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
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/workspace/phantom_window_controller.h" 5 #include "ash/wm/workspace/phantom_window_controller.h"
6 6
7 #include "ash/shell.h" 7 #include "ash/shell.h"
8 #include "ash/shell_window_ids.h" 8 #include "ash/shell_window_ids.h"
9 #include "third_party/skia/include/core/SkCanvas.h" 9 #include "third_party/skia/include/core/SkCanvas.h"
10 #include "ui/aura/window.h" 10 #include "ui/aura/window.h"
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
79 Hide(); 79 Hide();
80 } 80 }
81 81
82 void PhantomWindowController::Show(const gfx::Rect& bounds) { 82 void PhantomWindowController::Show(const gfx::Rect& bounds) {
83 if (bounds == bounds_) 83 if (bounds == bounds_)
84 return; 84 return;
85 bounds_ = bounds; 85 bounds_ = bounds;
86 if (!phantom_widget_.get()) { 86 if (!phantom_widget_.get()) {
87 // Show the phantom at the bounds of the window. We'll animate to the target 87 // Show the phantom at the bounds of the window. We'll animate to the target
88 // bounds. 88 // bounds.
89 start_bounds_ = window_->GetScreenBounds(); 89 start_bounds_ = window_->GetBoundsInScreen();
90 CreatePhantomWidget(start_bounds_); 90 CreatePhantomWidget(start_bounds_);
91 } else { 91 } else {
92 start_bounds_ = phantom_widget_->GetWindowScreenBounds(); 92 start_bounds_ = phantom_widget_->GetWindowBoundsInScreen();
93 } 93 }
94 animation_.reset(new ui::SlideAnimation(this)); 94 animation_.reset(new ui::SlideAnimation(this));
95 animation_->Show(); 95 animation_->Show();
96 } 96 }
97 97
98 void PhantomWindowController::SetBounds(const gfx::Rect& bounds) { 98 void PhantomWindowController::SetBounds(const gfx::Rect& bounds) {
99 DCHECK(IsShowing()); 99 DCHECK(IsShowing());
100 animation_.reset(); 100 animation_.reset();
101 bounds_ = bounds; 101 bounds_ = bounds;
102 phantom_widget_->SetBounds(bounds_); 102 phantom_widget_->SetBounds(bounds_);
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
143 phantom_widget_->Show(); 143 phantom_widget_->Show();
144 // Fade the window in. 144 // Fade the window in.
145 ui::Layer* layer = phantom_widget_->GetNativeWindow()->layer(); 145 ui::Layer* layer = phantom_widget_->GetNativeWindow()->layer();
146 layer->SetOpacity(0); 146 layer->SetOpacity(0);
147 ui::ScopedLayerAnimationSettings scoped_setter(layer->GetAnimator()); 147 ui::ScopedLayerAnimationSettings scoped_setter(layer->GetAnimator());
148 layer->SetOpacity(1); 148 layer->SetOpacity(1);
149 } 149 }
150 150
151 } // namespace internal 151 } // namespace internal
152 } // namespace ash 152 } // namespace ash
OLDNEW
« no previous file with comments | « ash/wm/workspace/multi_window_resize_controller_unittest.cc ('k') | ash/wm/workspace/snap_sizer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698