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 #include "base/i18n/case_conversion.h" | 7 #include "base/i18n/case_conversion.h" |
8 #include "base/i18n/rtl.h" | 8 #include "base/i18n/rtl.h" |
9 #include "base/run_loop.h" | 9 #include "base/run_loop.h" |
10 #include "base/time.h" | 10 #include "base/time.h" |
(...skipping 2237 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2248 // loop returns as soon as possible and avoids having deleted views classes | 2248 // loop returns as soon as possible and avoids having deleted views classes |
2249 // (such as widgets and rootviews) on the stack when the nested message loop | 2249 // (such as widgets and rootviews) on the stack when the nested message loop |
2250 // stops. | 2250 // stops. |
2251 // | 2251 // |
2252 // It's safe to invoke QuitNow multiple times, it only effects the current | 2252 // It's safe to invoke QuitNow multiple times, it only effects the current |
2253 // loop. | 2253 // loop. |
2254 bool quit_now = ShouldQuitNow() && exit_type_ != EXIT_NONE && | 2254 bool quit_now = ShouldQuitNow() && exit_type_ != EXIT_NONE && |
2255 message_loop_depth_; | 2255 message_loop_depth_; |
2256 | 2256 |
2257 if (quit_now) | 2257 if (quit_now) |
2258 MessageLoop::current()->QuitNow(); | 2258 base::MessageLoop::current()->QuitNow(); |
2259 } | 2259 } |
2260 | 2260 |
2261 void MenuController::HandleMouseLocation(SubmenuView* source, | 2261 void MenuController::HandleMouseLocation(SubmenuView* source, |
2262 const gfx::Point& mouse_location) { | 2262 const gfx::Point& mouse_location) { |
2263 if (showing_submenu_) | 2263 if (showing_submenu_) |
2264 return; | 2264 return; |
2265 | 2265 |
2266 MenuPart part = GetMenuPart(source, mouse_location); | 2266 MenuPart part = GetMenuPart(source, mouse_location); |
2267 | 2267 |
2268 UpdateScrolling(part); | 2268 UpdateScrolling(part); |
(...skipping 11 matching lines...) Expand all Loading... |
2280 (!pending_state_.item->HasSubmenu() || | 2280 (!pending_state_.item->HasSubmenu() || |
2281 !pending_state_.item->GetSubmenu()->IsShowing())) { | 2281 !pending_state_.item->GetSubmenu()->IsShowing())) { |
2282 // On exit if the user hasn't selected an item with a submenu, move the | 2282 // On exit if the user hasn't selected an item with a submenu, move the |
2283 // selection back to the parent menu item. | 2283 // selection back to the parent menu item. |
2284 SetSelection(pending_state_.item->GetParentMenuItem(), | 2284 SetSelection(pending_state_.item->GetParentMenuItem(), |
2285 SELECTION_OPEN_SUBMENU); | 2285 SELECTION_OPEN_SUBMENU); |
2286 } | 2286 } |
2287 } | 2287 } |
2288 | 2288 |
2289 } // namespace views | 2289 } // namespace views |
OLD | NEW |