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

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

Issue 151002: Fixing focus problems with the combobox (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: '' Created 11 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 | « views/controls/native_control.h ('k') | views/controls/native_control_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) 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 "views/controls/native_control.h" 5 #include "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 344 matching lines...) Expand 10 before | Expand all | Expand 10 after
355 // static 355 // static
356 LRESULT CALLBACK NativeControl::NativeControlWndProc(HWND window, UINT message, 356 LRESULT CALLBACK NativeControl::NativeControlWndProc(HWND window, UINT message,
357 WPARAM w_param, 357 WPARAM w_param,
358 LPARAM l_param) { 358 LPARAM l_param) {
359 HANDLE original_handler = GetProp(window, kHandlerKey); 359 HANDLE original_handler = GetProp(window, kHandlerKey);
360 DCHECK(original_handler); 360 DCHECK(original_handler);
361 NativeControl* native_control = 361 NativeControl* native_control =
362 static_cast<NativeControl*>(GetProp(window, kNativeControlKey)); 362 static_cast<NativeControl*>(GetProp(window, kNativeControlKey));
363 DCHECK(native_control); 363 DCHECK(native_control);
364 364
365 if (message == WM_KEYDOWN && native_control->NotifyOnKeyDown()) { 365 if (message == WM_KEYDOWN &&
366 if (native_control->OnKeyDown(static_cast<int>(w_param))) 366 native_control->OnKeyDown(static_cast<int>(w_param))) {
367 return 0; 367 return 0;
368 } else if (message == WM_SETFOCUS) { 368 } else if (message == WM_SETFOCUS) {
369 // Let the focus manager know that the focus changed. 369 // Let the focus manager know that the focus changed.
370 FocusManager* focus_manager = 370 FocusManager* focus_manager =
371 FocusManager::GetFocusManager(native_control->GetNativeControlHWND()); 371 FocusManager::GetFocusManager(native_control->GetNativeControlHWND());
372 if (focus_manager) { 372 if (focus_manager) {
373 focus_manager->SetFocusedView(native_control); 373 focus_manager->SetFocusedView(native_control);
374 } else { 374 } else {
375 NOTREACHED(); 375 NOTREACHED();
376 } 376 }
377 } else if (message == WM_DESTROY) { 377 } else if (message == WM_DESTROY) {
378 win_util::SetWindowProc(window, 378 win_util::SetWindowProc(window,
379 reinterpret_cast<WNDPROC>(original_handler)); 379 reinterpret_cast<WNDPROC>(original_handler));
380 RemoveProp(window, kHandlerKey); 380 RemoveProp(window, kHandlerKey);
381 RemoveProp(window, kNativeControlKey); 381 RemoveProp(window, kNativeControlKey);
382 } 382 }
383 383
384 return CallWindowProc(reinterpret_cast<WNDPROC>(original_handler), window, 384 return CallWindowProc(reinterpret_cast<WNDPROC>(original_handler), window,
385 message, w_param, l_param); 385 message, w_param, l_param);
386 } 386 }
387 387
388 } // namespace views 388 } // namespace views
OLDNEW
« no previous file with comments | « views/controls/native_control.h ('k') | views/controls/native_control_win.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698