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