| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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_WIDGET_WIN_H_ | 5 #ifndef VIEWS_WIDGET_WIDGET_WIN_H_ |
| 6 #define VIEWS_WIDGET_WIDGET_WIN_H_ | 6 #define VIEWS_WIDGET_WIDGET_WIN_H_ |
| 7 | 7 |
| 8 #include <atlbase.h> | 8 #include <atlbase.h> |
| 9 #include <atlapp.h> | 9 #include <atlapp.h> |
| 10 #include <atlcrack.h> | 10 #include <atlcrack.h> |
| 11 #include <atlmisc.h> | 11 #include <atlmisc.h> |
| 12 | 12 |
| 13 #include <vector> |
| 14 |
| 13 #include "app/win/window_impl.h" | 15 #include "app/win/window_impl.h" |
| 14 #include "base/message_loop.h" | 16 #include "base/message_loop.h" |
| 15 #include "base/scoped_comptr_win.h" | 17 #include "base/scoped_comptr_win.h" |
| 16 #include "views/focus/focus_manager.h" | 18 #include "views/focus/focus_manager.h" |
| 17 #include "views/layout_manager.h" | 19 #include "views/layout_manager.h" |
| 18 #include "views/widget/widget.h" | 20 #include "views/widget/widget.h" |
| 19 | 21 |
| 20 namespace gfx { | 22 namespace gfx { |
| 21 class Canvas; | 23 class Canvas; |
| 22 class Rect; | 24 class Rect; |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 85 } | 87 } |
| 86 | 88 |
| 87 // See description of use_layered_buffer_ for details. | 89 // See description of use_layered_buffer_ for details. |
| 88 void SetUseLayeredBuffer(bool use_layered_buffer); | 90 void SetUseLayeredBuffer(bool use_layered_buffer); |
| 89 | 91 |
| 90 // Disable Layered Window updates by setting to false. | 92 // Disable Layered Window updates by setting to false. |
| 91 void set_can_update_layered_window(bool can_update_layered_window) { | 93 void set_can_update_layered_window(bool can_update_layered_window) { |
| 92 can_update_layered_window_ = can_update_layered_window; | 94 can_update_layered_window_ = can_update_layered_window; |
| 93 } | 95 } |
| 94 | 96 |
| 97 // Obtain the view event with the given MSAA child id. Used in |
| 98 // ViewAccessibility::get_accChild to support requests for children of |
| 99 // windowless controls. May return NULL (see ViewHierarchyChanged). |
| 100 View* GetAccessibilityViewEventAt(int id); |
| 101 |
| 102 // Add a view that has recently fired an accessibility event. Returns a MSAA |
| 103 // child id which is generated by: -(index of view in vector + 1) which |
| 104 // guarantees a negative child id. This distinguishes the view from |
| 105 // positive MSAA child id's which are direct leaf children of views that have |
| 106 // associated hWnd's (e.g. WidgetWin). |
| 107 int AddAccessibilityViewEvent(View* view); |
| 108 |
| 109 // Clear a view that has recently been removed on a hierarchy change. |
| 110 void ClearAccessibilityViewEvent(View* view); |
| 111 |
| 95 BEGIN_MSG_MAP_EX(WidgetWin) | 112 BEGIN_MSG_MAP_EX(WidgetWin) |
| 96 // Range handlers must go first! | 113 // Range handlers must go first! |
| 97 MESSAGE_RANGE_HANDLER_EX(WM_MOUSEFIRST, WM_MOUSELAST, OnMouseRange) | 114 MESSAGE_RANGE_HANDLER_EX(WM_MOUSEFIRST, WM_MOUSELAST, OnMouseRange) |
| 98 MESSAGE_RANGE_HANDLER_EX(WM_NCMOUSEMOVE, WM_NCMOUSEMOVE, OnMouseRange) | 115 MESSAGE_RANGE_HANDLER_EX(WM_NCMOUSEMOVE, WM_NCMOUSEMOVE, OnMouseRange) |
| 99 | 116 |
| 100 // Reflected message handler | 117 // Reflected message handler |
| 101 MESSAGE_HANDLER_EX(kReflectedMessage, OnReflectedMessage) | 118 MESSAGE_HANDLER_EX(kReflectedMessage, OnReflectedMessage) |
| 102 | 119 |
| 103 // CustomFrameWindow hacks | 120 // CustomFrameWindow hacks |
| 104 MESSAGE_HANDLER_EX(WM_NCUAHDRAWCAPTION, OnNCUAHDrawCaption) | 121 MESSAGE_HANDLER_EX(WM_NCUAHDRAWCAPTION, OnNCUAHDrawCaption) |
| (...skipping 437 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 542 bool restore_focus_when_enabled_; | 559 bool restore_focus_when_enabled_; |
| 543 | 560 |
| 544 // Instance of accessibility information and handling for MSAA root | 561 // Instance of accessibility information and handling for MSAA root |
| 545 ScopedComPtr<IAccessible> accessibility_root_; | 562 ScopedComPtr<IAccessible> accessibility_root_; |
| 546 | 563 |
| 547 scoped_ptr<DefaultThemeProvider> default_theme_provider_; | 564 scoped_ptr<DefaultThemeProvider> default_theme_provider_; |
| 548 | 565 |
| 549 // Non owned pointer to optional delegate. May be NULL if no delegate is | 566 // Non owned pointer to optional delegate. May be NULL if no delegate is |
| 550 // being used. | 567 // being used. |
| 551 WidgetDelegate* delegate_; | 568 WidgetDelegate* delegate_; |
| 569 |
| 570 // The maximum number of view events in our vector below. |
| 571 static const int kMaxAccessibilityViewEvents = 20; |
| 572 |
| 573 // A vector used to access views for which we have sent notifications to |
| 574 // accessibility clients. It is used as a circular queue. |
| 575 std::vector<View*> accessibility_view_events_; |
| 576 |
| 577 // The current position of the view events vector. When incrementing, |
| 578 // we always mod this value with the max view events above . |
| 579 int accessibility_view_events_index_; |
| 552 }; | 580 }; |
| 553 | 581 |
| 554 } // namespace views | 582 } // namespace views |
| 555 | 583 |
| 556 #endif // VIEWS_WIDGET_WIDGET_WIN_H_ | 584 #endif // VIEWS_WIDGET_WIDGET_WIN_H_ |
| OLD | NEW |