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

Side by Side Diff: ui/views/controls/native_control.cc

Issue 16979002: Add ContextMenuSourceType to views::ContextMenuController::ShowContextMenuForView. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: patch Created 7 years, 6 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 | Annotate | Revision Log
« no previous file with comments | « ui/views/controls/menu/menu_runner.cc ('k') | ui/views/controls/native_control_win.cc » ('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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/native_control.h" 5 #include "ui/views/controls/native_control.h"
6 6
7 #include <atlbase.h> 7 #include <atlbase.h>
8 #include <atlapp.h> 8 #include <atlapp.h>
9 #include <atlcrack.h> 9 #include <atlcrack.h>
10 #include <atlframe.h> 10 #include <atlframe.h>
(...skipping 251 matching lines...) Expand 10 before | Expand all | Expand 10 after
262 } 262 }
263 263
264 hwnd_view_->SetBounds(x, y, width, height); 264 hwnd_view_->SetBounds(x, y, width, height);
265 } 265 }
266 } 266 }
267 267
268 void NativeControl::OnContextMenu(const POINT& location) { 268 void NativeControl::OnContextMenu(const POINT& location) {
269 if (!context_menu_controller()) 269 if (!context_menu_controller())
270 return; 270 return;
271 271
272 if (location.x == -1 && location.y == -1) 272 if (location.x == -1 && location.y == -1) {
273 ShowContextMenu(GetKeyboardContextMenuLocation(), false); 273 ShowContextMenu(GetKeyboardContextMenuLocation(),
274 else 274 ui::MENU_SOURCE_KEYBOARD);
275 ShowContextMenu(gfx::Point(location), true); 275 } else {
276 ShowContextMenu(gfx::Point(location), ui::MENU_SOURCE_MOUSE);
277 }
276 } 278 }
277 279
278 void NativeControl::OnFocus() { 280 void NativeControl::OnFocus() {
279 if (container_) { 281 if (container_) {
280 DCHECK(container_->GetControl()); 282 DCHECK(container_->GetControl());
281 ::SetFocus(container_->GetControl()); 283 ::SetFocus(container_->GetControl());
282 NotifyAccessibilityEvent(ui::AccessibilityTypes::EVENT_FOCUS, false); 284 NotifyAccessibilityEvent(ui::AccessibilityTypes::EVENT_FOCUS, false);
283 } 285 }
284 } 286 }
285 287
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
378 } else if (message == WM_DESTROY) { 380 } else if (message == WM_DESTROY) {
379 ui::SetWindowProc(window, reinterpret_cast<WNDPROC>(original_handler)); 381 ui::SetWindowProc(window, reinterpret_cast<WNDPROC>(original_handler));
380 native_control->container_->prop_.reset(); 382 native_control->container_->prop_.reset();
381 } 383 }
382 384
383 return CallWindowProc(reinterpret_cast<WNDPROC>(original_handler), window, 385 return CallWindowProc(reinterpret_cast<WNDPROC>(original_handler), window,
384 message, w_param, l_param); 386 message, w_param, l_param);
385 } 387 }
386 388
387 } // namespace views 389 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/controls/menu/menu_runner.cc ('k') | ui/views/controls/native_control_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698