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

Unified Diff: views/widget/widget_win.cc

Issue 6487002: Add a new constructor to KeyEvent. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 10 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 side-by-side diff with in-line comments
Download patch
« views/events/event_x.cc ('K') | « views/widget/widget_win.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: views/widget/widget_win.cc
===================================================================
--- views/widget/widget_win.cc (revision 74564)
+++ views/widget/widget_win.cc (working copy)
@@ -19,6 +19,7 @@
#include "ui/gfx/path.h"
#include "views/accessibility/view_accessibility.h"
#include "views/controls/native_control_win.h"
+#include "views/focus/accelerator_handler.h"
#include "views/focus/focus_util_win.h"
#include "views/views_delegate.h"
#include "views/widget/aero_tooltip_manager.h"
@@ -53,8 +54,12 @@
// Links the HWND to it's Widget (as a Widget, not a WidgetWin).
static const char* const kWidgetKey = "__VIEWS_WIDGET__";
+// static
bool WidgetWin::screen_reader_active_ = false;
+// static
+std::vector<MSG>* WidgetWin::current_messages_ = NULL;
+
// A custom MSAA object id used to determine if a screen reader is actively
// listening for MSAA events.
#define OBJID_CUSTOM 1
@@ -521,12 +526,15 @@
// MessageLoop::Observer
void WidgetWin::WillProcessMessage(const MSG& msg) {
+ if (!current_messages_)
+ current_messages_ = new std::vector<MSG>;
+ current_messages_->push_back(msg);
}
void WidgetWin::DidProcessMessage(const MSG& msg) {
- if (root_view_->NeedsPainting(true)) {
+ if (root_view_->NeedsPainting(true))
PaintNow(root_view_->GetScheduledPaintRect());
- }
+ current_messages_->pop_back();
}
////////////////////////////////////////////////////////////////////////////////
@@ -689,9 +697,7 @@
}
void WidgetWin::OnKeyDown(TCHAR c, UINT rep_cnt, UINT flags) {
- KeyEvent event(ui::ET_KEY_PRESSED, ui::KeyboardCodeForWindowsKeyCode(c),
- KeyEvent::GetKeyStateFlags(), rep_cnt, flags,
- WM_KEYDOWN);
+ KeyEvent event(current_messages_->back());
RootView* root_view = GetFocusedViewRootView();
if (!root_view)
root_view = root_view_.get();
@@ -700,9 +706,7 @@
}
void WidgetWin::OnKeyUp(TCHAR c, UINT rep_cnt, UINT flags) {
- KeyEvent event(ui::ET_KEY_RELEASED, ui::KeyboardCodeForWindowsKeyCode(c),
- KeyEvent::GetKeyStateFlags(), rep_cnt, flags,
- WM_KEYUP);
+ KeyEvent event(current_messages_->back());
RootView* root_view = GetFocusedViewRootView();
if (!root_view)
root_view = root_view_.get();
« views/events/event_x.cc ('K') | « views/widget/widget_win.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698