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

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

Issue 1924703002: Rename gfx::Display/Screen to display::Display/Screen in ash (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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 | « ash/wm/drag_window_controller.h ('k') | ash/wm/drag_window_resizer.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_controller.h" 5 #include "ash/wm/drag_window_controller.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "ash/display/window_tree_host_manager.h" 9 #include "ash/display/window_tree_host_manager.h"
10 #include "ash/screen_util.h" 10 #include "ash/screen_util.h"
(...skipping 14 matching lines...) Expand all
25 #include "ui/views/widget/widget.h" 25 #include "ui/views/widget/widget.h"
26 #include "ui/wm/core/shadow_types.h" 26 #include "ui/wm/core/shadow_types.h"
27 #include "ui/wm/core/window_util.h" 27 #include "ui/wm/core/window_util.h"
28 28
29 namespace ash { 29 namespace ash {
30 30
31 // This keeps tack of the drag window's state. It creates/destory/updates bounds 31 // This keeps tack of the drag window's state. It creates/destory/updates bounds
32 // and opacity based on the current bounds. 32 // and opacity based on the current bounds.
33 class DragWindowController::DragWindowDetails : public aura::WindowDelegate { 33 class DragWindowController::DragWindowDetails : public aura::WindowDelegate {
34 public: 34 public:
35 DragWindowDetails(const gfx::Display& display, aura::Window* original_window) 35 DragWindowDetails(const display::Display& display,
36 aura::Window* original_window)
36 : root_window_(Shell::GetInstance() 37 : root_window_(Shell::GetInstance()
37 ->window_tree_host_manager() 38 ->window_tree_host_manager()
38 ->GetRootWindowForDisplayId(display.id())) {} 39 ->GetRootWindowForDisplayId(display.id())) {}
39 40
40 ~DragWindowDetails() override { 41 ~DragWindowDetails() override {
41 delete drag_window_; 42 delete drag_window_;
42 DCHECK(!drag_window_); 43 DCHECK(!drag_window_);
43 } 44 }
44 45
45 void Update(aura::Window* original_window, 46 void Update(aura::Window* original_window,
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after
175 // The maximum opacity of the drag phantom window. 176 // The maximum opacity of the drag phantom window.
176 static const float kMaxOpacity = 0.8f; 177 static const float kMaxOpacity = 0.8f;
177 178
178 return kMaxOpacity * visible_bounds.size().GetArea() / 179 return kMaxOpacity * visible_bounds.size().GetArea() /
179 window_bounds.size().GetArea(); 180 window_bounds.size().GetArea();
180 } 181 }
181 182
182 DragWindowController::DragWindowController(aura::Window* window) 183 DragWindowController::DragWindowController(aura::Window* window)
183 : window_(window) { 184 : window_(window) {
184 DCHECK(drag_windows_.empty()); 185 DCHECK(drag_windows_.empty());
185 gfx::Screen* screen = gfx::Screen::GetScreen(); 186 display::Screen* screen = display::Screen::GetScreen();
186 gfx::Display current = screen->GetDisplayNearestWindow(window_); 187 display::Display current = screen->GetDisplayNearestWindow(window_);
187 188
188 for (const gfx::Display& display : screen->GetAllDisplays()) { 189 for (const display::Display& display : screen->GetAllDisplays()) {
189 if (current.id() == display.id()) 190 if (current.id() == display.id())
190 continue; 191 continue;
191 drag_windows_.push_back( 192 drag_windows_.push_back(
192 base::WrapUnique(new DragWindowDetails(display, window_))); 193 base::WrapUnique(new DragWindowDetails(display, window_)));
193 } 194 }
194 } 195 }
195 196
196 DragWindowController::~DragWindowController() {} 197 DragWindowController::~DragWindowController() {}
197 198
198 void DragWindowController::Update(const gfx::Rect& bounds_in_screen, 199 void DragWindowController::Update(const gfx::Rect& bounds_in_screen,
(...skipping 29 matching lines...) Expand all
228 if (details->layer_owner_) { 229 if (details->layer_owner_) {
229 if (index == 0) 230 if (index == 0)
230 return details->layer_owner_.get(); 231 return details->layer_owner_.get();
231 index--; 232 index--;
232 } 233 }
233 } 234 }
234 return nullptr; 235 return nullptr;
235 } 236 }
236 237
237 } // namespace ash 238 } // namespace ash
OLDNEW
« no previous file with comments | « ash/wm/drag_window_controller.h ('k') | ash/wm/drag_window_resizer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698