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

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

Issue 6246001: Move app/key* to ui/base/keycodes/* (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 years, 11 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/scrollbar/bitmap_scroll_bar.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) 2010 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/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>
11 #include <atlmisc.h> 11 #include <atlmisc.h>
12 12
13 #include "app/keyboard_code_conversion_win.h"
14 #include "app/keyboard_codes.h"
15 #include "app/l10n_util_win.h" 13 #include "app/l10n_util_win.h"
16 #include "app/win/hwnd_util.h" 14 #include "app/win/hwnd_util.h"
17 #include "app/view_prop.h" 15 #include "app/view_prop.h"
18 #include "base/logging.h" 16 #include "base/logging.h"
19 #include "base/scoped_ptr.h" 17 #include "base/scoped_ptr.h"
20 #include "gfx/native_theme_win.h" 18 #include "gfx/native_theme_win.h"
19 #include "ui/base/keycodes/keyboard_codes.h"
20 #include "ui/base/keycodes/keyboard_code_conversion_win.h"
21 #include "views/background.h" 21 #include "views/background.h"
22 #include "views/border.h" 22 #include "views/border.h"
23 #include "views/controls/native/native_view_host.h" 23 #include "views/controls/native/native_view_host.h"
24 #include "views/focus/focus_manager.h" 24 #include "views/focus/focus_manager.h"
25 #include "views/widget/widget.h" 25 #include "views/widget/widget.h"
26 26
27 using app::ViewProp; 27 using app::ViewProp;
28 28
29 namespace views { 29 namespace views {
30 30
(...skipping 333 matching lines...) Expand 10 before | Expand all | Expand 10 after
364 UINT message, 364 UINT message,
365 WPARAM w_param, 365 WPARAM w_param,
366 LPARAM l_param) { 366 LPARAM l_param) {
367 NativeControl* native_control = static_cast<NativeControl*>( 367 NativeControl* native_control = static_cast<NativeControl*>(
368 ViewProp::GetValue(window, kNativeControlKey)); 368 ViewProp::GetValue(window, kNativeControlKey));
369 DCHECK(native_control); 369 DCHECK(native_control);
370 WNDPROC original_handler = native_control->container_->original_handler_; 370 WNDPROC original_handler = native_control->container_->original_handler_;
371 DCHECK(original_handler); 371 DCHECK(original_handler);
372 372
373 if (message == WM_KEYDOWN && 373 if (message == WM_KEYDOWN &&
374 native_control->OnKeyDown(app::KeyboardCodeForWindowsKeyCode(w_param))) { 374 native_control->OnKeyDown(ui::KeyboardCodeForWindowsKeyCode(w_param))) {
375 return 0; 375 return 0;
376 } else if (message == WM_SETFOCUS) { 376 } else if (message == WM_SETFOCUS) {
377 // Let the focus manager know that the focus changed. 377 // Let the focus manager know that the focus changed.
378 FocusManager* focus_manager = native_control->GetFocusManager(); 378 FocusManager* focus_manager = native_control->GetFocusManager();
379 if (focus_manager) { 379 if (focus_manager) {
380 focus_manager->SetFocusedView(native_control); 380 focus_manager->SetFocusedView(native_control);
381 } else { 381 } else {
382 NOTREACHED(); 382 NOTREACHED();
383 } 383 }
384 } else if (message == WM_DESTROY) { 384 } else if (message == WM_DESTROY) {
385 app::win::SetWindowProc(window, 385 app::win::SetWindowProc(window,
386 reinterpret_cast<WNDPROC>(original_handler)); 386 reinterpret_cast<WNDPROC>(original_handler));
387 native_control->container_->prop_.reset(); 387 native_control->container_->prop_.reset();
388 } 388 }
389 389
390 return CallWindowProc(reinterpret_cast<WNDPROC>(original_handler), window, 390 return CallWindowProc(reinterpret_cast<WNDPROC>(original_handler), window,
391 message, w_param, l_param); 391 message, w_param, l_param);
392 } 392 }
393 393
394 } // namespace views 394 } // namespace views
OLDNEW
« no previous file with comments | « views/controls/native_control.h ('k') | views/controls/scrollbar/bitmap_scroll_bar.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698