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

Side by Side Diff: ui/aura/root_window_host_win.cc

Issue 11412315: Make the cursor have separate mode for disabled mouse events and invisible. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 8 years 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 "ui/aura/root_window_host_win.h" 5 #include "ui/aura/root_window_host_win.h"
6 6
7 #include <windows.h> 7 #include <windows.h>
8 8
9 #include <algorithm> 9 #include <algorithm>
10 10
11 #include "base/message_loop.h" 11 #include "base/message_loop.h"
12 #include "ui/aura/client/capture_client.h" 12 #include "ui/aura/client/capture_client.h"
13 #include "ui/aura/client/cursor_client.h"
13 #include "ui/aura/root_window.h" 14 #include "ui/aura/root_window.h"
14 #include "ui/base/cursor/cursor_loader_win.h" 15 #include "ui/base/cursor/cursor_loader_win.h"
15 #include "ui/base/events/event.h" 16 #include "ui/base/events/event.h"
16 #include "ui/base/view_prop.h" 17 #include "ui/base/view_prop.h"
17 #include "ui/gfx/display.h" 18 #include "ui/gfx/display.h"
18 #include "ui/gfx/screen.h" 19 #include "ui/gfx/screen.h"
19 20
20 using std::max; 21 using std::max;
21 using std::min; 22 using std::min;
22 23
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after
170 } 171 }
171 172
172 void RootWindowHostWin::ReleaseCapture() { 173 void RootWindowHostWin::ReleaseCapture() {
173 if (has_capture_) { 174 if (has_capture_) {
174 has_capture_ = false; 175 has_capture_ = false;
175 ::ReleaseCapture(); 176 ::ReleaseCapture();
176 } 177 }
177 } 178 }
178 179
179 bool RootWindowHostWin::QueryMouseLocation(gfx::Point* location_return) { 180 bool RootWindowHostWin::QueryMouseLocation(gfx::Point* location_return) {
181 client::CursorClient* cursor_client =
182 client::GetCursorClient(GetRootWindow());
183 if (cursor_client && !cursor_client->IsCursorEnabled()) {
184 *location_return = gfx::Point(0, 0);
185 return false;
186 }
187
180 POINT pt; 188 POINT pt;
181 GetCursorPos(&pt); 189 GetCursorPos(&pt);
182 ScreenToClient(hwnd(), &pt); 190 ScreenToClient(hwnd(), &pt);
183 const gfx::Size size = GetBounds().size(); 191 const gfx::Size size = GetBounds().size();
184 *location_return = 192 *location_return =
185 gfx::Point(max(0, min(size.width(), static_cast<int>(pt.x))), 193 gfx::Point(max(0, min(size.width(), static_cast<int>(pt.x))),
186 max(0, min(size.height(), static_cast<int>(pt.y)))); 194 max(0, min(size.height(), static_cast<int>(pt.y))));
187 return (pt.x >= 0 && static_cast<int>(pt.x) < size.width() && 195 return (pt.x >= 0 && static_cast<int>(pt.x) < size.width() &&
188 pt.y >= 0 && static_cast<int>(pt.y) < size.height()); 196 pt.y >= 0 && static_cast<int>(pt.y) < size.height());
189 } 197 }
(...skipping 15 matching lines...) Expand all
205 const gfx::Rect& snapshot_bounds, 213 const gfx::Rect& snapshot_bounds,
206 std::vector<unsigned char>* png_representation) { 214 std::vector<unsigned char>* png_representation) {
207 NOTIMPLEMENTED(); 215 NOTIMPLEMENTED();
208 return false; 216 return false;
209 } 217 }
210 218
211 void RootWindowHostWin::UnConfineCursor() { 219 void RootWindowHostWin::UnConfineCursor() {
212 ClipCursor(NULL); 220 ClipCursor(NULL);
213 } 221 }
214 222
215 void RootWindowHostWin::OnCursorVisibilityChanged(bool show) { 223 void RootWindowHostWin::OnCursorEnableStateChanged(bool enabled) {
216 NOTIMPLEMENTED(); 224 NOTIMPLEMENTED();
217 } 225 }
218 226
219 void RootWindowHostWin::MoveCursorTo(const gfx::Point& location) { 227 void RootWindowHostWin::MoveCursorTo(const gfx::Point& location) {
220 // Deliberately not implemented. 228 // Deliberately not implemented.
221 } 229 }
222 230
223 void RootWindowHostWin::SetFocusWhenShown(bool focus_when_shown) { 231 void RootWindowHostWin::SetFocusWhenShown(bool focus_when_shown) {
224 NOTIMPLEMENTED(); 232 NOTIMPLEMENTED();
225 } 233 }
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
303 namespace test { 311 namespace test {
304 312
305 // static 313 // static
306 void SetUsePopupAsRootWindowForTest(bool use) { 314 void SetUsePopupAsRootWindowForTest(bool use) {
307 use_popup_as_root_window_for_test = use; 315 use_popup_as_root_window_for_test = use;
308 } 316 }
309 317
310 } // namespace test 318 } // namespace test
311 319
312 } // namespace aura 320 } // namespace aura
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698