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

Side by Side Diff: app/win/window_impl.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, 12 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 | « app/win/window_impl.h ('k') | base/file_util_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 "gfx/window_impl.h" 5 #include "app/win/window_impl.h"
6 6
7 #include <list> 7 #include <list>
8 8
9 #include "app/win/hwnd_util.h"
9 #include "base/singleton.h" 10 #include "base/singleton.h"
10 #include "base/string_number_conversions.h" 11 #include "base/string_number_conversions.h"
11 #include "base/win_util.h"
12 12
13 namespace gfx { 13 namespace app {
14 namespace win {
14 15
15 static const DWORD kWindowDefaultChildStyle = 16 static const DWORD kWindowDefaultChildStyle =
16 WS_CHILD | WS_VISIBLE | WS_CLIPCHILDREN | WS_CLIPSIBLINGS; 17 WS_CHILD | WS_VISIBLE | WS_CLIPCHILDREN | WS_CLIPSIBLINGS;
17 static const DWORD kWindowDefaultStyle = WS_OVERLAPPEDWINDOW; 18 static const DWORD kWindowDefaultStyle = WS_OVERLAPPEDWINDOW;
18 static const DWORD kWindowDefaultExStyle = 0; 19 static const DWORD kWindowDefaultExStyle = 0;
19 20
20 /////////////////////////////////////////////////////////////////////////////// 21 ///////////////////////////////////////////////////////////////////////////////
21 // WindowImpl class tracking. 22 // WindowImpl class tracking.
22 23
23 // Several external scripts rely explicitly on this base class name for 24 // Several external scripts rely explicitly on this base class name for
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after
142 width = bounds.width(); 143 width = bounds.width();
143 height = bounds.height(); 144 height = bounds.height();
144 } 145 }
145 146
146 hwnd_ = CreateWindowEx(window_ex_style_, GetWindowClassName().c_str(), NULL, 147 hwnd_ = CreateWindowEx(window_ex_style_, GetWindowClassName().c_str(), NULL,
147 window_style_, x, y, width, height, 148 window_style_, x, y, width, height,
148 parent, NULL, NULL, this); 149 parent, NULL, NULL, this);
149 DCHECK(hwnd_); 150 DCHECK(hwnd_);
150 151
151 // The window procedure should have set the data for us. 152 // The window procedure should have set the data for us.
152 DCHECK(win_util::GetWindowUserData(hwnd_) == this); 153 DCHECK(app::win::GetWindowUserData(hwnd_) == this);
153 } 154 }
154 155
155 HICON WindowImpl::GetDefaultWindowIcon() const { 156 HICON WindowImpl::GetDefaultWindowIcon() const {
156 return NULL; 157 return NULL;
157 } 158 }
158 159
159 // static 160 // static
160 bool WindowImpl::IsWindowImpl(HWND hwnd) { 161 bool WindowImpl::IsWindowImpl(HWND hwnd) {
161 wchar_t tmp[128]; 162 wchar_t tmp[128];
162 if (!::GetClassName(hwnd, tmp, 128)) 163 if (!::GetClassName(hwnd, tmp, 128))
(...skipping 16 matching lines...) Expand all
179 180
180 // static 181 // static
181 LRESULT CALLBACK WindowImpl::WndProc(HWND hwnd, 182 LRESULT CALLBACK WindowImpl::WndProc(HWND hwnd,
182 UINT message, 183 UINT message,
183 WPARAM w_param, 184 WPARAM w_param,
184 LPARAM l_param) { 185 LPARAM l_param) {
185 if (message == WM_NCCREATE) { 186 if (message == WM_NCCREATE) {
186 CREATESTRUCT* cs = reinterpret_cast<CREATESTRUCT*>(l_param); 187 CREATESTRUCT* cs = reinterpret_cast<CREATESTRUCT*>(l_param);
187 WindowImpl* window = reinterpret_cast<WindowImpl*>(cs->lpCreateParams); 188 WindowImpl* window = reinterpret_cast<WindowImpl*>(cs->lpCreateParams);
188 DCHECK(window); 189 DCHECK(window);
189 win_util::SetWindowUserData(hwnd, window); 190 app::win::SetWindowUserData(hwnd, window);
190 window->hwnd_ = hwnd; 191 window->hwnd_ = hwnd;
191 return TRUE; 192 return TRUE;
192 } 193 }
193 194
194 WindowImpl* window = reinterpret_cast<WindowImpl*>( 195 WindowImpl* window = reinterpret_cast<WindowImpl*>(
195 win_util::GetWindowUserData(hwnd)); 196 app::win::GetWindowUserData(hwnd));
196 if (!window) 197 if (!window)
197 return 0; 198 return 0;
198 199
199 return window->OnWndProc(message, w_param, l_param); 200 return window->OnWndProc(message, w_param, l_param);
200 } 201 }
201 202
202 std::wstring WindowImpl::GetWindowClassName() { 203 std::wstring WindowImpl::GetWindowClassName() {
203 ClassInfo class_info(initial_class_style()); 204 ClassInfo class_info(initial_class_style());
204 std::wstring name; 205 std::wstring name;
205 if (ClassRegistrar::GetInstance()->RetrieveClassName(class_info, &name)) 206 if (ClassRegistrar::GetInstance()->RetrieveClassName(class_info, &name))
(...skipping 14 matching lines...) Expand all
220 class_ex.lpszClassName = name.c_str(); 221 class_ex.lpszClassName = name.c_str();
221 class_ex.hIconSm = class_ex.hIcon; 222 class_ex.hIconSm = class_ex.hIcon;
222 ATOM atom = RegisterClassEx(&class_ex); 223 ATOM atom = RegisterClassEx(&class_ex);
223 DCHECK(atom); 224 DCHECK(atom);
224 225
225 ClassRegistrar::GetInstance()->RegisterClass(class_info, name, atom); 226 ClassRegistrar::GetInstance()->RegisterClass(class_info, name, atom);
226 227
227 return name; 228 return name;
228 } 229 }
229 230
230 } // namespace gfx 231 } // namespace win
232 } // namespace app
OLDNEW
« no previous file with comments | « app/win/window_impl.h ('k') | base/file_util_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698