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

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

Issue 125148: Making FocusManager portable to toolkit_views (Closed) Base URL: svn://chrome-svn/chrome/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/menu/chrome_menu.cc ('k') | 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) 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 349 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 && native_control->NotifyOnKeyDown()) {
366 if (native_control->OnKeyDown(static_cast<int>(w_param))) 366 if (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 = native_control->GetFocusManager();
371 FocusManager::GetFocusManager(native_control->GetNativeControlHWND());
372 if (focus_manager) { 371 if (focus_manager) {
373 focus_manager->SetFocusedView(native_control); 372 focus_manager->SetFocusedView(native_control);
374 } else { 373 } else {
375 NOTREACHED(); 374 NOTREACHED();
376 } 375 }
377 } else if (message == WM_DESTROY) { 376 } else if (message == WM_DESTROY) {
378 win_util::SetWindowProc(window, 377 win_util::SetWindowProc(window,
379 reinterpret_cast<WNDPROC>(original_handler)); 378 reinterpret_cast<WNDPROC>(original_handler));
380 RemoveProp(window, kHandlerKey); 379 RemoveProp(window, kHandlerKey);
381 RemoveProp(window, kNativeControlKey); 380 RemoveProp(window, kNativeControlKey);
382 } 381 }
383 382
384 return CallWindowProc(reinterpret_cast<WNDPROC>(original_handler), window, 383 return CallWindowProc(reinterpret_cast<WNDPROC>(original_handler), window,
385 message, w_param, l_param); 384 message, w_param, l_param);
386 } 385 }
387 386
388 } // namespace views 387 } // namespace views
OLDNEW
« no previous file with comments | « views/controls/menu/chrome_menu.cc ('k') | views/controls/native_control_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698