| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "ui/views/controls/menu/menu_message_pump_dispatcher.h" | 5 #include "ui/views/controls/menu/menu_message_pump_dispatcher_win.h" |
| 6 | 6 |
| 7 #include <windowsx.h> | 7 #include <windowsx.h> |
| 8 | 8 |
| 9 #include "ui/events/event_utils.h" | 9 #include "ui/events/event_utils.h" |
| 10 #include "ui/events/keycodes/keyboard_code_conversion.h" | 10 #include "ui/events/keycodes/keyboard_code_conversion.h" |
| 11 #include "ui/events/keycodes/keyboard_codes.h" | 11 #include "ui/events/keycodes/keyboard_codes.h" |
| 12 #include "ui/views/controls/menu/menu_controller.h" | 12 #include "ui/views/controls/menu/menu_controller.h" |
| 13 | 13 |
| 14 namespace views { | 14 namespace views { |
| 15 namespace internal { | 15 namespace internal { |
| 16 | 16 |
| 17 MenuMessagePumpDispatcher::MenuMessagePumpDispatcher(MenuController* controller) |
| 18 : menu_controller_(controller) {} |
| 19 |
| 20 MenuMessagePumpDispatcher::~MenuMessagePumpDispatcher() {} |
| 21 |
| 17 uint32_t MenuMessagePumpDispatcher::Dispatch(const MSG& msg) { | 22 uint32_t MenuMessagePumpDispatcher::Dispatch(const MSG& msg) { |
| 18 DCHECK(menu_controller_->IsBlockingRun()); | 23 DCHECK(menu_controller_->IsBlockingRun()); |
| 19 | 24 |
| 20 if (menu_controller_->exit_type() == MenuController::EXIT_ALL || | 25 if (menu_controller_->exit_type() == MenuController::EXIT_ALL || |
| 21 menu_controller_->exit_type() == MenuController::EXIT_DESTROYED) | 26 menu_controller_->exit_type() == MenuController::EXIT_DESTROYED) |
| 22 return (POST_DISPATCH_QUIT_LOOP | POST_DISPATCH_PERFORM_DEFAULT); | 27 return (POST_DISPATCH_QUIT_LOOP | POST_DISPATCH_PERFORM_DEFAULT); |
| 23 | 28 |
| 24 // NOTE: we don't get WM_ACTIVATE or anything else interesting in here. | 29 // NOTE: we don't get WM_ACTIVATE or anything else interesting in here. |
| 25 switch (msg.message) { | 30 switch (msg.message) { |
| 26 case WM_CONTEXTMENU: { | 31 case WM_CONTEXTMENU: { |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 69 break; | 74 break; |
| 70 } | 75 } |
| 71 return POST_DISPATCH_PERFORM_DEFAULT | | 76 return POST_DISPATCH_PERFORM_DEFAULT | |
| 72 (menu_controller_->exit_type() == MenuController::EXIT_NONE | 77 (menu_controller_->exit_type() == MenuController::EXIT_NONE |
| 73 ? POST_DISPATCH_NONE | 78 ? POST_DISPATCH_NONE |
| 74 : POST_DISPATCH_QUIT_LOOP); | 79 : POST_DISPATCH_QUIT_LOOP); |
| 75 } | 80 } |
| 76 | 81 |
| 77 } // namespace internal | 82 } // namespace internal |
| 78 } // namespace views | 83 } // namespace views |
| OLD | NEW |