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

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

Issue 6019007: Remove win_util::FormatMessage and FormatLastWin32Error. These were only used... (Closed) Base URL: svn://chrome-svn/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/menu/native_menu_win.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) 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" 13 #include "app/keyboard_code_conversion_win.h"
14 #include "app/keyboard_codes.h" 14 #include "app/keyboard_codes.h"
15 #include "app/l10n_util_win.h" 15 #include "app/l10n_util_win.h"
16 #include "app/win/hwnd_util.h"
16 #include "app/view_prop.h" 17 #include "app/view_prop.h"
17 #include "base/logging.h" 18 #include "base/logging.h"
18 #include "base/scoped_ptr.h" 19 #include "base/scoped_ptr.h"
19 #include "base/win_util.h"
20 #include "gfx/native_theme_win.h" 20 #include "gfx/native_theme_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 {
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
82 delete this; 82 delete this;
83 } 83 }
84 84
85 private: 85 private:
86 friend class NativeControl; 86 friend class NativeControl;
87 87
88 LRESULT OnCreate(LPCREATESTRUCT create_struct) { 88 LRESULT OnCreate(LPCREATESTRUCT create_struct) {
89 control_ = parent_->CreateNativeControl(m_hWnd); 89 control_ = parent_->CreateNativeControl(m_hWnd);
90 90
91 // We subclass the control hwnd so we get the WM_KEYDOWN messages. 91 // We subclass the control hwnd so we get the WM_KEYDOWN messages.
92 original_handler_ = win_util::SetWindowProc( 92 original_handler_ = app::win::SetWindowProc(
93 control_, &NativeControl::NativeControlWndProc); 93 control_, &NativeControl::NativeControlWndProc);
94 prop_.reset(new ViewProp(control_, kNativeControlKey , parent_)); 94 prop_.reset(new ViewProp(control_, kNativeControlKey , parent_));
95 95
96 ::ShowWindow(control_, SW_SHOW); 96 ::ShowWindow(control_, SW_SHOW);
97 return 1; 97 return 1;
98 } 98 }
99 99
100 LRESULT OnEraseBkgnd(HDC dc) { 100 LRESULT OnEraseBkgnd(HDC dc) {
101 return 1; 101 return 1;
102 } 102 }
(...skipping 272 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 win_util::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/menu/native_menu_win.cc ('k') | views/controls/native_control_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698