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/view_prop.h" | 9 #include "app/view_prop.h" |
11 #include "app/win/hwnd_util.h" | 10 #include "app/win/hwnd_util.h" |
12 #include "app/win/win_util.h" | 11 #include "app/win/win_util.h" |
13 #include "base/string_util.h" | 12 #include "base/string_util.h" |
14 #include "gfx/canvas_skia.h" | 13 #include "gfx/canvas_skia.h" |
15 #include "gfx/native_theme_win.h" | 14 #include "gfx/native_theme_win.h" |
16 #include "gfx/path.h" | 15 #include "gfx/path.h" |
| 16 #include "ui/base/keycodes/keyboard_code_conversion_win.h" |
17 #include "views/accessibility/view_accessibility.h" | 17 #include "views/accessibility/view_accessibility.h" |
18 #include "views/controls/native_control_win.h" | 18 #include "views/controls/native_control_win.h" |
19 #include "views/focus/focus_util_win.h" | 19 #include "views/focus/focus_util_win.h" |
20 #include "views/views_delegate.h" | 20 #include "views/views_delegate.h" |
21 #include "views/widget/aero_tooltip_manager.h" | 21 #include "views/widget/aero_tooltip_manager.h" |
22 #include "views/widget/child_window_message_processor.h" | 22 #include "views/widget/child_window_message_processor.h" |
23 #include "views/widget/default_theme_provider.h" | 23 #include "views/widget/default_theme_provider.h" |
24 #include "views/widget/drop_target_win.h" | 24 #include "views/widget/drop_target_win.h" |
25 #include "views/widget/root_view.h" | 25 #include "views/widget/root_view.h" |
26 #include "views/widget/widget_delegate.h" | 26 #include "views/widget/widget_delegate.h" |
(...skipping 627 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
654 SetMsgHandled(FALSE); | 654 SetMsgHandled(FALSE); |
655 } | 655 } |
656 | 656 |
657 void WidgetWin::OnInitMenuPopup(HMENU menu, | 657 void WidgetWin::OnInitMenuPopup(HMENU menu, |
658 UINT position, | 658 UINT position, |
659 BOOL is_system_menu) { | 659 BOOL is_system_menu) { |
660 SetMsgHandled(FALSE); | 660 SetMsgHandled(FALSE); |
661 } | 661 } |
662 | 662 |
663 void WidgetWin::OnKeyDown(TCHAR c, UINT rep_cnt, UINT flags) { | 663 void WidgetWin::OnKeyDown(TCHAR c, UINT rep_cnt, UINT flags) { |
664 KeyEvent event(Event::ET_KEY_PRESSED, app::KeyboardCodeForWindowsKeyCode(c), | 664 KeyEvent event(Event::ET_KEY_PRESSED, ui::KeyboardCodeForWindowsKeyCode(c), |
665 KeyEvent::GetKeyStateFlags(), rep_cnt, flags, | 665 KeyEvent::GetKeyStateFlags(), rep_cnt, flags, |
666 WM_KEYDOWN); | 666 WM_KEYDOWN); |
667 RootView* root_view = GetFocusedViewRootView(); | 667 RootView* root_view = GetFocusedViewRootView(); |
668 if (!root_view) | 668 if (!root_view) |
669 root_view = root_view_.get(); | 669 root_view = root_view_.get(); |
670 | 670 |
671 SetMsgHandled(root_view->ProcessKeyEvent(event)); | 671 SetMsgHandled(root_view->ProcessKeyEvent(event)); |
672 } | 672 } |
673 | 673 |
674 void WidgetWin::OnKeyUp(TCHAR c, UINT rep_cnt, UINT flags) { | 674 void WidgetWin::OnKeyUp(TCHAR c, UINT rep_cnt, UINT flags) { |
675 KeyEvent event(Event::ET_KEY_RELEASED, app::KeyboardCodeForWindowsKeyCode(c), | 675 KeyEvent event(Event::ET_KEY_RELEASED, ui::KeyboardCodeForWindowsKeyCode(c), |
676 KeyEvent::GetKeyStateFlags(), rep_cnt, flags, | 676 KeyEvent::GetKeyStateFlags(), rep_cnt, flags, |
677 WM_KEYUP); | 677 WM_KEYUP); |
678 RootView* root_view = GetFocusedViewRootView(); | 678 RootView* root_view = GetFocusedViewRootView(); |
679 if (!root_view) | 679 if (!root_view) |
680 root_view = root_view_.get(); | 680 root_view = root_view_.get(); |
681 | 681 |
682 SetMsgHandled(root_view->ProcessKeyEvent(event)); | 682 SetMsgHandled(root_view->ProcessKeyEvent(event)); |
683 } | 683 } |
684 | 684 |
685 void WidgetWin::OnKillFocus(HWND focused_window) { | 685 void WidgetWin::OnKillFocus(HWND focused_window) { |
(...skipping 671 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1357 Widget* Widget::GetWidgetFromNativeWindow(gfx::NativeWindow native_window) { | 1357 Widget* Widget::GetWidgetFromNativeWindow(gfx::NativeWindow native_window) { |
1358 return Widget::GetWidgetFromNativeView(native_window); | 1358 return Widget::GetWidgetFromNativeView(native_window); |
1359 } | 1359 } |
1360 | 1360 |
1361 // static | 1361 // static |
1362 void Widget::NotifyLocaleChanged() { | 1362 void Widget::NotifyLocaleChanged() { |
1363 NOTIMPLEMENTED(); | 1363 NOTIMPLEMENTED(); |
1364 } | 1364 } |
1365 | 1365 |
1366 } // namespace views | 1366 } // namespace views |
OLD | NEW |