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

Side by Side Diff: ash/display/cursor_window_controller.cc

Issue 201573015: Introdcue AshWindowTreeHost and move ash/chrome specific code in WTH to ash. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 6 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/display/DEPS ('k') | ash/display/display_controller.h » ('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 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/display/cursor_window_controller.h" 5 #include "ash/display/cursor_window_controller.h"
6 6
7 #include "ash/display/display_controller.h" 7 #include "ash/display/display_controller.h"
8 #include "ash/display/mirror_window_controller.h" 8 #include "ash/display/mirror_window_controller.h"
9 #include "ash/root_window_controller.h" 9 #include "ash/root_window_controller.h"
10 #include "ash/shell.h" 10 #include "ash/shell.h"
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
110 UpdateCursorImage(); 110 UpdateCursorImage();
111 UpdateContainer(); 111 UpdateContainer();
112 } 112 }
113 } 113 }
114 114
115 void CursorWindowController::UpdateContainer() { 115 void CursorWindowController::UpdateContainer() {
116 display_ = Shell::GetScreen()->GetPrimaryDisplay(); 116 display_ = Shell::GetScreen()->GetPrimaryDisplay();
117 if (is_cursor_compositing_enabled_) { 117 if (is_cursor_compositing_enabled_) {
118 SetDisplay(display_); 118 SetDisplay(display_);
119 } else { 119 } else {
120 aura::WindowTreeHost* mirror_host = Shell::GetInstance()-> 120 SetContainer(Shell::GetInstance()->
121 display_controller()->mirror_window_controller()->host(); 121 display_controller()->
122 SetContainer(mirror_host ? mirror_host->window() : NULL); 122 mirror_window_controller()->
123 GetWindow());
123 } 124 }
124 } 125 }
125 126
126 void CursorWindowController::SetDisplay(const gfx::Display& display) { 127 void CursorWindowController::SetDisplay(const gfx::Display& display) {
127 if (!is_cursor_compositing_enabled_) 128 if (!is_cursor_compositing_enabled_)
128 return; 129 return;
129 130
130 display_ = display; 131 display_ = display;
131 aura::Window* root_window = Shell::GetInstance()->display_controller()-> 132 aura::Window* root_window = Shell::GetInstance()->display_controller()->
132 GetRootWindowForDisplayId(display.id()); 133 GetRootWindowForDisplayId(display.id());
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after
251 delegate_->SetCursorImage(rotated, display_); 252 delegate_->SetCursorImage(rotated, display_);
252 if (cursor_window_) { 253 if (cursor_window_) {
253 cursor_window_->SetBounds(gfx::Rect(delegate_->size())); 254 cursor_window_->SetBounds(gfx::Rect(delegate_->size()));
254 cursor_window_->SchedulePaintInRect( 255 cursor_window_->SchedulePaintInRect(
255 gfx::Rect(cursor_window_->bounds().size())); 256 gfx::Rect(cursor_window_->bounds().size()));
256 UpdateLocation(); 257 UpdateLocation();
257 } 258 }
258 } 259 }
259 260
260 } // namespace ash 261 } // namespace ash
OLDNEW
« no previous file with comments | « ash/display/DEPS ('k') | ash/display/display_controller.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698