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

Side by Side Diff: chrome/browser/chromeos/accessibility/accessibility_highlight_manager.cc

Issue 2354783004: Fix overflow/underflow in gfx geometry once and for all (Closed)
Patch Set: Now with 'fix' for accessibility interactive ui test Created 4 years, 3 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 | « no previous file | ui/gfx/geometry/mojo/geometry.typemap » ('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) 2016 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2016 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/shell.h" 5 #include "ash/shell.h"
6 #include "chrome/browser/chromeos/accessibility/accessibility_highlight_manager. h" 6 #include "chrome/browser/chromeos/accessibility/accessibility_highlight_manager. h"
7 #include "chrome/browser/chromeos/ui/accessibility_focus_ring_controller.h" 7 #include "chrome/browser/chromeos/ui/accessibility_focus_ring_controller.h"
8 #include "content/public/browser/focused_node_details.h" 8 #include "content/public/browser/focused_node_details.h"
9 #include "content/public/browser/notification_service.h" 9 #include "content/public/browser/notification_service.h"
10 #include "content/public/browser/notification_types.h" 10 #include "content/public/browser/notification_types.h"
11 #include "ui/aura/window_tree_host.h" 11 #include "ui/aura/window_tree_host.h"
12 #include "ui/wm/core/cursor_manager.h" 12 #include "ui/wm/core/cursor_manager.h"
13 13
14 namespace chromeos { 14 namespace chromeos {
15 15
16 namespace { 16 namespace {
17 17
18 // TODO: don't hide carets and focus ring "offscreen" by using large numbers.
18 const gfx::Rect& OffscreenRect() { 19 const gfx::Rect& OffscreenRect() {
19 CR_DEFINE_STATIC_LOCAL(const gfx::Rect, r, (INT_MIN, INT_MIN, 0, 0)); 20 CR_DEFINE_STATIC_LOCAL(const gfx::Rect, r,
21 (INT_MAX - 1000, INT_MAX - 1000, 0, 0));
enne (OOO) 2016/09/23 00:17:06 Surprisingly, AccessibilityHighlightManagerTest.Te
dmazzoni 2016/10/04 22:29:32 Working on a cleaner fix for this here: https://c
20 return r; 22 return r;
21 } 23 }
22 24
23 const gfx::Point& OffscreenPoint() { 25 const gfx::Point& OffscreenPoint() {
24 CR_DEFINE_STATIC_LOCAL(const gfx::Point, p, (INT_MIN, INT_MIN)); 26 CR_DEFINE_STATIC_LOCAL(const gfx::Point, p, (INT_MAX - 1000, INT_MAX - 1000));
25 return p; 27 return p;
26 } 28 }
27 29
28 ui::InputMethod* GetInputMethod(aura::Window* root_window) { 30 ui::InputMethod* GetInputMethod(aura::Window* root_window) {
29 if (root_window->GetHost()) 31 if (root_window->GetHost())
30 return root_window->GetHost()->GetInputMethod(); 32 return root_window->GetHost()->GetInputMethod();
31 return nullptr; 33 return nullptr;
32 } 34 }
33 35
34 } // namespace 36 } // namespace
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after
169 if (!cursor_) 171 if (!cursor_)
170 point = OffscreenPoint(); 172 point = OffscreenPoint();
171 173
172 if (!IsCursorVisible()) 174 if (!IsCursorVisible())
173 point = OffscreenPoint(); 175 point = OffscreenPoint();
174 176
175 AccessibilityFocusRingController::GetInstance()->SetCursorRing(point); 177 AccessibilityFocusRingController::GetInstance()->SetCursorRing(point);
176 } 178 }
177 179
178 } // namespace chromeos 180 } // namespace chromeos
OLDNEW
« no previous file with comments | « no previous file | ui/gfx/geometry/mojo/geometry.typemap » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698