| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_controller.h" | 5 #include "ui/views/controls/menu/menu_controller.h" |
| 6 | 6 |
| 7 #if defined(OS_WIN) | 7 #if defined(OS_WIN) |
| 8 #include <windowsx.h> | 8 #include <windowsx.h> |
| 9 #endif | 9 #endif |
| 10 | 10 |
| (...skipping 2144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2155 #endif | 2155 #endif |
| 2156 | 2156 |
| 2157 scoped_ptr<ui::LocatedEvent> clone; | 2157 scoped_ptr<ui::LocatedEvent> clone; |
| 2158 if (event.IsMouseEvent()) { | 2158 if (event.IsMouseEvent()) { |
| 2159 clone.reset(new ui::MouseEvent(static_cast<const ui::MouseEvent&>(event))); | 2159 clone.reset(new ui::MouseEvent(static_cast<const ui::MouseEvent&>(event))); |
| 2160 } else if (event.IsGestureEvent()) { | 2160 } else if (event.IsGestureEvent()) { |
| 2161 // TODO(rbyers): Gesture event repost is tricky to get right | 2161 // TODO(rbyers): Gesture event repost is tricky to get right |
| 2162 // crbug.com/170987. | 2162 // crbug.com/170987. |
| 2163 return; | 2163 return; |
| 2164 } else { | 2164 } else { |
| 2165 // TODO - remove this |
| 2166 LOG(ERROR) << "Got event of type " << event.type(); |
| 2165 NOTREACHED(); | 2167 NOTREACHED(); |
| 2166 return; | 2168 return; |
| 2167 } | 2169 } |
| 2168 clone->set_location(screen_loc); | 2170 clone->set_location(screen_loc); |
| 2169 | 2171 |
| 2170 RepostLocatedEvent(window, *clone); | 2172 RepostLocatedEvent(window, *clone); |
| 2171 } | 2173 } |
| 2172 | 2174 |
| 2173 | 2175 |
| 2174 void MenuController::SetDropMenuItem( | 2176 void MenuController::SetDropMenuItem( |
| (...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2337 (!pending_state_.item->HasSubmenu() || | 2339 (!pending_state_.item->HasSubmenu() || |
| 2338 !pending_state_.item->GetSubmenu()->IsShowing())) { | 2340 !pending_state_.item->GetSubmenu()->IsShowing())) { |
| 2339 // On exit if the user hasn't selected an item with a submenu, move the | 2341 // On exit if the user hasn't selected an item with a submenu, move the |
| 2340 // selection back to the parent menu item. | 2342 // selection back to the parent menu item. |
| 2341 SetSelection(pending_state_.item->GetParentMenuItem(), | 2343 SetSelection(pending_state_.item->GetParentMenuItem(), |
| 2342 SELECTION_OPEN_SUBMENU); | 2344 SELECTION_OPEN_SUBMENU); |
| 2343 } | 2345 } |
| 2344 } | 2346 } |
| 2345 | 2347 |
| 2346 } // namespace views | 2348 } // namespace views |
| OLD | NEW |