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

Side by Side Diff: chrome/views/menu_button.cc

Issue 14601: Some cleanup in view menu delegate (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: Created 12 years 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 | Annotate | Revision Log
« no previous file with comments | « chrome/views/checkbox.cc ('k') | chrome/views/view_menu_delegate.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) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2008 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 <atlbase.h> 5 #include <atlbase.h>
6 #include <atlapp.h> 6 #include <atlapp.h>
7 7
8 #include "chrome/views/menu_button.h" 8 #include "chrome/views/menu_button.h"
9 9
10 #include "chrome/app/theme/theme_resources.h" 10 #include "chrome/app/theme/theme_resources.h"
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after
150 // We're about to show the menu from a mouse press. By showing from the 150 // We're about to show the menu from a mouse press. By showing from the
151 // mouse press event we block RootView in mouse dispatching. This also 151 // mouse press event we block RootView in mouse dispatching. This also
152 // appears to cause RootView to get a mouse pressed BEFORE the mouse 152 // appears to cause RootView to get a mouse pressed BEFORE the mouse
153 // release is seen, which means RootView sends us another mouse press no 153 // release is seen, which means RootView sends us another mouse press no
154 // matter where the user pressed. To force RootView to recalculate the 154 // matter where the user pressed. To force RootView to recalculate the
155 // mouse target during the mouse press we explicitly set the mouse handler 155 // mouse target during the mouse press we explicitly set the mouse handler
156 // to NULL. 156 // to NULL.
157 GetRootView()->SetMouseHandler(NULL); 157 GetRootView()->SetMouseHandler(NULL);
158 158
159 menu_visible_ = true; 159 menu_visible_ = true;
160 menu_delegate_->RunMenu(this, menu_position.ToPOINT(), 160 menu_delegate_->RunMenu(this, menu_position, GetWidget()->GetHWND());
161 GetWidget()->GetHWND());
162 menu_visible_ = false; 161 menu_visible_ = false;
163 menu_closed_time_ = Time::Now(); 162 menu_closed_time_ = Time::Now();
164 163
165 // Now that the menu has closed, we need to manually reset state to 164 // Now that the menu has closed, we need to manually reset state to
166 // "normal" since the menu modal loop will have prevented normal 165 // "normal" since the menu modal loop will have prevented normal
167 // mouse move messages from getting to this View. We set "normal" 166 // mouse move messages from getting to this View. We set "normal"
168 // and not "hot" because the likelihood is that the mouse is now 167 // and not "hot" because the likelihood is that the mouse is now
169 // somewhere else (user clicked elsewhere on screen to close the menu 168 // somewhere else (user clicked elsewhere on screen to close the menu
170 // or selected an item) and we will inevitably refresh the hot state 169 // or selected an item) and we will inevitably refresh the hot state
171 // in the event the mouse _is_ over the view. 170 // in the event the mouse _is_ over the view.
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
249 } 248 }
250 249
251 bool MenuButton::GetAccessibleState(VARIANT* state) { 250 bool MenuButton::GetAccessibleState(VARIANT* state) {
252 DCHECK(state); 251 DCHECK(state);
253 252
254 state->lVal |= STATE_SYSTEM_HASPOPUP; 253 state->lVal |= STATE_SYSTEM_HASPOPUP;
255 return true; 254 return true;
256 } 255 }
257 256
258 } // namespace views 257 } // namespace views
OLDNEW
« no previous file with comments | « chrome/views/checkbox.cc ('k') | chrome/views/view_menu_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698