Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(136)

Side by Side Diff: views/controls/menu/menu_host_root_view.cc

Issue 1664001: Fixes possible crash if the window hosting a menu was closed while the (Closed)
Patch Set: Incorporated review feedback Created 10 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « views/controls/menu/menu_host_gtk.cc ('k') | views/controls/menu/menu_host_win.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2009 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/controls/menu/menu_host_root_view.h" 5 #include "views/controls/menu/menu_host_root_view.h"
6 6
7 #include "views/controls/menu/menu_controller.h" 7 #include "views/controls/menu/menu_controller.h"
8 #include "views/controls/menu/submenu_view.h" 8 #include "views/controls/menu/submenu_view.h"
9 9
10 namespace views { 10 namespace views {
11 11
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
49 49
50 void MenuHostRootView::OnMouseReleased(const MouseEvent& event, 50 void MenuHostRootView::OnMouseReleased(const MouseEvent& event,
51 bool canceled) { 51 bool canceled) {
52 if (suspend_events_) 52 if (suspend_events_)
53 return; 53 return;
54 54
55 RootView::OnMouseReleased(event, canceled); 55 RootView::OnMouseReleased(event, canceled);
56 if (forward_drag_to_menu_controller_) { 56 if (forward_drag_to_menu_controller_) {
57 forward_drag_to_menu_controller_ = false; 57 forward_drag_to_menu_controller_ = false;
58 if (canceled) { 58 if (canceled) {
59 GetMenuController()->Cancel(true); 59 GetMenuController()->Cancel(MenuController::EXIT_ALL);
60 } else { 60 } else {
61 GetMenuController()->OnMouseReleased(submenu_, event); 61 GetMenuController()->OnMouseReleased(submenu_, event);
62 } 62 }
63 } 63 }
64 } 64 }
65 65
66 void MenuHostRootView::OnMouseMoved(const MouseEvent& event) { 66 void MenuHostRootView::OnMouseMoved(const MouseEvent& event) {
67 if (suspend_events_) 67 if (suspend_events_)
68 return; 68 return;
69 69
(...skipping 13 matching lines...) Expand all
83 // have a focused view, so we need to override this then forward to 83 // have a focused view, so we need to override this then forward to
84 // the menu. 84 // the menu.
85 return submenu_->OnMouseWheel(e); 85 return submenu_->OnMouseWheel(e);
86 } 86 }
87 87
88 MenuController* MenuHostRootView::GetMenuController() { 88 MenuController* MenuHostRootView::GetMenuController() {
89 return submenu_->GetMenuItem()->GetMenuController(); 89 return submenu_->GetMenuItem()->GetMenuController();
90 } 90 }
91 91
92 } // namespace views 92 } // namespace views
OLDNEW
« no previous file with comments | « views/controls/menu/menu_host_gtk.cc ('k') | views/controls/menu/menu_host_win.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698