| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 VIEWS_WIDGET_NATIVE_WIDGET_WIN_H_ | 5 #ifndef VIEWS_WIDGET_NATIVE_WIDGET_WIN_H_ |
| 6 #define VIEWS_WIDGET_NATIVE_WIDGET_WIN_H_ | 6 #define VIEWS_WIDGET_NATIVE_WIDGET_WIN_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <atlbase.h> | 9 #include <atlbase.h> |
| 10 #include <atlapp.h> | 10 #include <atlapp.h> |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 95 static gfx::Font GetWindowTitleFont(); | 95 static gfx::Font GetWindowTitleFont(); |
| 96 | 96 |
| 97 // Show the window with the specified show command. | 97 // Show the window with the specified show command. |
| 98 void Show(int show_state); | 98 void Show(int show_state); |
| 99 | 99 |
| 100 // Disable Layered Window updates by setting to false. | 100 // Disable Layered Window updates by setting to false. |
| 101 void set_can_update_layered_window(bool can_update_layered_window) { | 101 void set_can_update_layered_window(bool can_update_layered_window) { |
| 102 can_update_layered_window_ = can_update_layered_window; | 102 can_update_layered_window_ = can_update_layered_window; |
| 103 } | 103 } |
| 104 | 104 |
| 105 // Obtain the view event with the given MSAA child id. Used in | 105 // Obtain the view corresponding to a MSAA child id. Used in |
| 106 // NativeViewAccessibilityWin::get_accChild to support requests for | 106 // NativeViewAccessibilityWin::get_accChild to support requests for |
| 107 // children of windowless controls. May return NULL | 107 // children of windowless controls. May return NULL |
| 108 // (see ViewHierarchyChanged). | 108 // (see ViewHierarchyChanged). |
| 109 View* GetAccessibilityViewEventAt(int id); | 109 View* GetViewByAccessibleId(long id); |
| 110 | |
| 111 // Add a view that has recently fired an accessibility event. Returns a MSAA | |
| 112 // child id which is generated by: -(index of view in vector + 1) which | |
| 113 // guarantees a negative child id. This distinguishes the view from | |
| 114 // positive MSAA child id's which are direct leaf children of views that have | |
| 115 // associated hWnd's (e.g. NativeWidgetWin). | |
| 116 int AddAccessibilityViewEvent(View* view); | |
| 117 | |
| 118 // Clear a view that has recently been removed on a hierarchy change. | |
| 119 void ClearAccessibilityViewEvent(View* view); | |
| 120 | 110 |
| 121 // Hides the window if it hasn't already been force-hidden. The force hidden | 111 // Hides the window if it hasn't already been force-hidden. The force hidden |
| 122 // count is tracked, so calling multiple times is allowed, you just have to | 112 // count is tracked, so calling multiple times is allowed, you just have to |
| 123 // be sure to call PopForceHidden the same number of times. | 113 // be sure to call PopForceHidden the same number of times. |
| 124 void PushForceHidden(); | 114 void PushForceHidden(); |
| 125 | 115 |
| 126 // Decrements the force hidden count, showing the window if we have reached | 116 // Decrements the force hidden count, showing the window if we have reached |
| 127 // the top of the stack. See PushForceHidden. | 117 // the top of the stack. See PushForceHidden. |
| 128 void PopForceHidden(); | 118 void PopForceHidden(); |
| 129 | 119 |
| (...skipping 397 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 527 // Stops ignoring SetWindowPos() requests (see below). | 517 // Stops ignoring SetWindowPos() requests (see below). |
| 528 void StopIgnoringPosChanges() { ignore_window_pos_changes_ = false; } | 518 void StopIgnoringPosChanges() { ignore_window_pos_changes_ = false; } |
| 529 | 519 |
| 530 void RestoreEnabledIfNecessary(); | 520 void RestoreEnabledIfNecessary(); |
| 531 | 521 |
| 532 void SetInitialFocus(); | 522 void SetInitialFocus(); |
| 533 | 523 |
| 534 // Overridden from internal::InputMethodDelegate | 524 // Overridden from internal::InputMethodDelegate |
| 535 virtual void DispatchKeyEventPostIME(const KeyEvent& key) OVERRIDE; | 525 virtual void DispatchKeyEventPostIME(const KeyEvent& key) OVERRIDE; |
| 536 | 526 |
| 527 // Recursively search through all descendant views to find one with |
| 528 // this IAccessible2 unique id and return the View if found, or |
| 529 // NULL if not. |
| 530 View* FindViewByIA2UniqueId(long id, View* view); |
| 531 |
| 537 // A delegate implementation that handles events received here. | 532 // A delegate implementation that handles events received here. |
| 538 // See class documentation for Widget in widget.h for a note about ownership. | 533 // See class documentation for Widget in widget.h for a note about ownership. |
| 539 internal::NativeWidgetDelegate* delegate_; | 534 internal::NativeWidgetDelegate* delegate_; |
| 540 | 535 |
| 541 // The following factory is used for calls to close the NativeWidgetWin | 536 // The following factory is used for calls to close the NativeWidgetWin |
| 542 // instance. | 537 // instance. |
| 543 base::WeakPtrFactory<NativeWidgetWin> close_widget_factory_; | 538 base::WeakPtrFactory<NativeWidgetWin> close_widget_factory_; |
| 544 | 539 |
| 545 // The flags currently being used with TrackMouseEvent to track mouse | 540 // The flags currently being used with TrackMouseEvent to track mouse |
| 546 // messages. 0 if there is no active tracking. The value of this member is | 541 // messages. 0 if there is no active tracking. The value of this member is |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 588 // Whether the focus should be restored next time we get enabled. Needed to | 583 // Whether the focus should be restored next time we get enabled. Needed to |
| 589 // restore focus correctly when Windows modal dialogs are displayed. | 584 // restore focus correctly when Windows modal dialogs are displayed. |
| 590 bool restore_focus_when_enabled_; | 585 bool restore_focus_when_enabled_; |
| 591 | 586 |
| 592 // Instance of accessibility information and handling for MSAA root | 587 // Instance of accessibility information and handling for MSAA root |
| 593 base::win::ScopedComPtr<IAccessible> accessibility_root_; | 588 base::win::ScopedComPtr<IAccessible> accessibility_root_; |
| 594 | 589 |
| 595 // Value determines whether the Widget is customized for accessibility. | 590 // Value determines whether the Widget is customized for accessibility. |
| 596 static bool screen_reader_active_; | 591 static bool screen_reader_active_; |
| 597 | 592 |
| 598 // The maximum number of view events in our vector below. | |
| 599 static const int kMaxAccessibilityViewEvents = 20; | |
| 600 | |
| 601 // A vector used to access views for which we have sent notifications to | |
| 602 // accessibility clients. It is used as a circular queue. | |
| 603 std::vector<View*> accessibility_view_events_; | |
| 604 | |
| 605 // The current position of the view events vector. When incrementing, | |
| 606 // we always mod this value with the max view events above . | |
| 607 int accessibility_view_events_index_; | |
| 608 | |
| 609 // The last cursor that was active before the current one was selected. Saved | 593 // The last cursor that was active before the current one was selected. Saved |
| 610 // so that we can restore it. | 594 // so that we can restore it. |
| 611 gfx::NativeCursor previous_cursor_; | 595 gfx::NativeCursor previous_cursor_; |
| 612 | 596 |
| 613 ViewProps props_; | 597 ViewProps props_; |
| 614 | 598 |
| 615 // True if we're in fullscreen mode. | 599 // True if we're in fullscreen mode. |
| 616 bool fullscreen_; | 600 bool fullscreen_; |
| 617 | 601 |
| 618 // If this is greater than zero, we should prevent attempts to make the window | 602 // If this is greater than zero, we should prevent attempts to make the window |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 666 // rather than asking the Widget for the non_client_view so that we know at | 650 // rather than asking the Widget for the non_client_view so that we know at |
| 667 // Init time, before the Widget has created the NonClientView. | 651 // Init time, before the Widget has created the NonClientView. |
| 668 bool has_non_client_view_; | 652 bool has_non_client_view_; |
| 669 | 653 |
| 670 DISALLOW_COPY_AND_ASSIGN(NativeWidgetWin); | 654 DISALLOW_COPY_AND_ASSIGN(NativeWidgetWin); |
| 671 }; | 655 }; |
| 672 | 656 |
| 673 } // namespace views | 657 } // namespace views |
| 674 | 658 |
| 675 #endif // VIEWS_WIDGET_NATIVE_WIDGET_WIN_H_ | 659 #endif // VIEWS_WIDGET_NATIVE_WIDGET_WIN_H_ |
| OLD | NEW |