| OLD | NEW |
| 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 #ifndef CONTENT_BROWSER_ACCESSIBILITY_BROWSER_ACCESSIBILITY_MANAGER_H_ | 5 #ifndef CONTENT_BROWSER_ACCESSIBILITY_BROWSER_ACCESSIBILITY_MANAGER_H_ |
| 6 #define CONTENT_BROWSER_ACCESSIBILITY_BROWSER_ACCESSIBILITY_MANAGER_H_ | 6 #define CONTENT_BROWSER_ACCESSIBILITY_BROWSER_ACCESSIBILITY_MANAGER_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <memory> | 10 #include <memory> |
| (...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 233 | 233 |
| 234 // Fire an event telling native assistive technology to move focus to the | 234 // Fire an event telling native assistive technology to move focus to the |
| 235 // given find in page result. | 235 // given find in page result. |
| 236 void ActivateFindInPageResult(int request_id, int match_index); | 236 void ActivateFindInPageResult(int request_id, int match_index); |
| 237 | 237 |
| 238 // Called when the renderer process has notified us of about tree changes. | 238 // Called when the renderer process has notified us of about tree changes. |
| 239 virtual void OnAccessibilityEvents( | 239 virtual void OnAccessibilityEvents( |
| 240 const std::vector<AXEventNotificationDetails>& details); | 240 const std::vector<AXEventNotificationDetails>& details); |
| 241 | 241 |
| 242 // Called when the renderer process updates the location of accessibility | 242 // Called when the renderer process updates the location of accessibility |
| 243 // objects. | 243 // objects. Calls SendLocationChangeEvents(), which can be overridden. |
| 244 virtual void OnLocationChanges( | 244 void OnLocationChanges( |
| 245 const std::vector<AccessibilityHostMsg_LocationChangeParams>& params); | 245 const std::vector<AccessibilityHostMsg_LocationChangeParams>& params); |
| 246 | 246 |
| 247 // Called when a new find in page result is received. We hold on to this | 247 // Called when a new find in page result is received. We hold on to this |
| 248 // information and don't activate it until the user requests it. | 248 // information and don't activate it until the user requests it. |
| 249 void OnFindInPageResult( | 249 void OnFindInPageResult( |
| 250 int request_id, int match_index, int start_id, int start_offset, | 250 int request_id, int match_index, int start_id, int start_offset, |
| 251 int end_id, int end_offset); | 251 int end_id, int end_offset); |
| 252 | 252 |
| 253 // Called in response to a hit test, when the object hit has a child frame | 253 // Called in response to a hit test, when the object hit has a child frame |
| 254 // (like an iframe element or browser plugin), and we need to do another | 254 // (like an iframe element or browser plugin), and we need to do another |
| (...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 359 protected: | 359 protected: |
| 360 BrowserAccessibilityManager( | 360 BrowserAccessibilityManager( |
| 361 BrowserAccessibilityDelegate* delegate, | 361 BrowserAccessibilityDelegate* delegate, |
| 362 BrowserAccessibilityFactory* factory); | 362 BrowserAccessibilityFactory* factory); |
| 363 | 363 |
| 364 BrowserAccessibilityManager( | 364 BrowserAccessibilityManager( |
| 365 const ui::AXTreeUpdate& initial_tree, | 365 const ui::AXTreeUpdate& initial_tree, |
| 366 BrowserAccessibilityDelegate* delegate, | 366 BrowserAccessibilityDelegate* delegate, |
| 367 BrowserAccessibilityFactory* factory); | 367 BrowserAccessibilityFactory* factory); |
| 368 | 368 |
| 369 // Send platform-specific notifications to each of these objects that |
| 370 // their location has changed. This is called by OnLocationChanges |
| 371 // after it's updated the internal data structure. |
| 372 virtual void SendLocationChangeEvents( |
| 373 const std::vector<AccessibilityHostMsg_LocationChangeParams>& params); |
| 374 |
| 369 private: | 375 private: |
| 370 // The following states keep track of whether or not the | 376 // The following states keep track of whether or not the |
| 371 // on-screen keyboard is allowed to be shown. | 377 // on-screen keyboard is allowed to be shown. |
| 372 enum OnScreenKeyboardState { | 378 enum OnScreenKeyboardState { |
| 373 // Never show the on-screen keyboard because this tab is hidden. | 379 // Never show the on-screen keyboard because this tab is hidden. |
| 374 OSK_DISALLOWED_BECAUSE_TAB_HIDDEN, | 380 OSK_DISALLOWED_BECAUSE_TAB_HIDDEN, |
| 375 | 381 |
| 376 // This tab was just shown, so don't pop-up the on-screen keyboard if a | 382 // This tab was just shown, so don't pop-up the on-screen keyboard if a |
| 377 // text field gets focus that wasn't the result of an explicit touch. | 383 // text field gets focus that wasn't the result of an explicit touch. |
| 378 OSK_DISALLOWED_BECAUSE_TAB_JUST_APPEARED, | 384 OSK_DISALLOWED_BECAUSE_TAB_JUST_APPEARED, |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 427 // node within that parent tree. It's computed as needed and cached for | 433 // node within that parent tree. It's computed as needed and cached for |
| 428 // speed so that it can be accessed quickly if it hasn't changed. | 434 // speed so that it can be accessed quickly if it hasn't changed. |
| 429 int parent_node_id_from_parent_tree_; | 435 int parent_node_id_from_parent_tree_; |
| 430 | 436 |
| 431 DISALLOW_COPY_AND_ASSIGN(BrowserAccessibilityManager); | 437 DISALLOW_COPY_AND_ASSIGN(BrowserAccessibilityManager); |
| 432 }; | 438 }; |
| 433 | 439 |
| 434 } // namespace content | 440 } // namespace content |
| 435 | 441 |
| 436 #endif // CONTENT_BROWSER_ACCESSIBILITY_BROWSER_ACCESSIBILITY_MANAGER_H_ | 442 #endif // CONTENT_BROWSER_ACCESSIBILITY_BROWSER_ACCESSIBILITY_MANAGER_H_ |
| OLD | NEW |