OLD | NEW |
1 // Copyright (c) 2010 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 #include "views/widget/widget_win.h" | 5 #include "views/widget/widget_win.h" |
6 | 6 |
| 7 #include "app/keyboard_code_conversion_win.h" |
7 #include "app/l10n_util_win.h" | 8 #include "app/l10n_util_win.h" |
8 #include "app/system_monitor.h" | 9 #include "app/system_monitor.h" |
9 #include "app/win_util.h" | 10 #include "app/win_util.h" |
10 #include "base/string_util.h" | 11 #include "base/string_util.h" |
11 #include "base/win_util.h" | 12 #include "base/win_util.h" |
12 #include "gfx/canvas_skia.h" | 13 #include "gfx/canvas_skia.h" |
13 #include "gfx/native_theme_win.h" | 14 #include "gfx/native_theme_win.h" |
14 #include "gfx/path.h" | 15 #include "gfx/path.h" |
15 #include "views/accessibility/view_accessibility.h" | 16 #include "views/accessibility/view_accessibility.h" |
16 #include "views/controls/native_control_win.h" | 17 #include "views/controls/native_control_win.h" |
(...skipping 648 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
665 SetMsgHandled(FALSE); | 666 SetMsgHandled(FALSE); |
666 } | 667 } |
667 | 668 |
668 void WidgetWin::OnInitMenuPopup(HMENU menu, | 669 void WidgetWin::OnInitMenuPopup(HMENU menu, |
669 UINT position, | 670 UINT position, |
670 BOOL is_system_menu) { | 671 BOOL is_system_menu) { |
671 SetMsgHandled(FALSE); | 672 SetMsgHandled(FALSE); |
672 } | 673 } |
673 | 674 |
674 void WidgetWin::OnKeyDown(TCHAR c, UINT rep_cnt, UINT flags) { | 675 void WidgetWin::OnKeyDown(TCHAR c, UINT rep_cnt, UINT flags) { |
675 KeyEvent event(Event::ET_KEY_PRESSED, win_util::WinToKeyboardCode(c), | 676 KeyEvent event(Event::ET_KEY_PRESSED, app::KeyboardCodeForWindowsKeyCode(c), |
676 KeyEvent::GetKeyStateFlags(), rep_cnt, flags); | 677 KeyEvent::GetKeyStateFlags(), rep_cnt, flags); |
677 RootView* root_view = GetFocusedViewRootView(); | 678 RootView* root_view = GetFocusedViewRootView(); |
678 if (!root_view) | 679 if (!root_view) |
679 root_view = root_view_.get(); | 680 root_view = root_view_.get(); |
680 | 681 |
681 SetMsgHandled(root_view->ProcessKeyEvent(event)); | 682 SetMsgHandled(root_view->ProcessKeyEvent(event)); |
682 } | 683 } |
683 | 684 |
684 void WidgetWin::OnKeyUp(TCHAR c, UINT rep_cnt, UINT flags) { | 685 void WidgetWin::OnKeyUp(TCHAR c, UINT rep_cnt, UINT flags) { |
685 KeyEvent event(Event::ET_KEY_RELEASED, win_util::WinToKeyboardCode(c), | 686 KeyEvent event(Event::ET_KEY_RELEASED, app::KeyboardCodeForWindowsKeyCode(c), |
686 KeyEvent::GetKeyStateFlags(), rep_cnt, flags); | 687 KeyEvent::GetKeyStateFlags(), rep_cnt, flags); |
687 RootView* root_view = GetFocusedViewRootView(); | 688 RootView* root_view = GetFocusedViewRootView(); |
688 if (!root_view) | 689 if (!root_view) |
689 root_view = root_view_.get(); | 690 root_view = root_view_.get(); |
690 | 691 |
691 SetMsgHandled(root_view->ProcessKeyEvent(event)); | 692 SetMsgHandled(root_view->ProcessKeyEvent(event)); |
692 } | 693 } |
693 | 694 |
694 void WidgetWin::OnKillFocus(HWND focused_window) { | 695 void WidgetWin::OnKillFocus(HWND focused_window) { |
695 GetFocusManager()->GetWidgetFocusManager()->OnWidgetFocusEvent( | 696 GetFocusManager()->GetWidgetFocusManager()->OnWidgetFocusEvent( |
(...skipping 670 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1366 Widget* Widget::GetWidgetFromNativeWindow(gfx::NativeWindow native_window) { | 1367 Widget* Widget::GetWidgetFromNativeWindow(gfx::NativeWindow native_window) { |
1367 return Widget::GetWidgetFromNativeView(native_window); | 1368 return Widget::GetWidgetFromNativeView(native_window); |
1368 } | 1369 } |
1369 | 1370 |
1370 // static | 1371 // static |
1371 void Widget::NotifyLocaleChanged() { | 1372 void Widget::NotifyLocaleChanged() { |
1372 NOTIMPLEMENTED(); | 1373 NOTIMPLEMENTED(); |
1373 } | 1374 } |
1374 | 1375 |
1375 } // namespace views | 1376 } // namespace views |
OLD | NEW |