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

Side by Side Diff: app/win/window_impl.cc

Issue 2124009: Fix a crasher with "select file" dialogs. (Closed) Base URL: http://src.chromium.org/git/chromium.git
Patch Set: Merge Created 10 years, 7 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
« no previous file with comments | « app/win/window_impl.h ('k') | views/widget/widget_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) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 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 "app/win/window_impl.h" 5 #include "app/win/window_impl.h"
6 6
7 #include <list> 7 #include <list>
8 8
9 #include "base/singleton.h" 9 #include "base/singleton.h"
10 #include "base/string_util.h" 10 #include "base/string_util.h"
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after
145 DCHECK(hwnd_); 145 DCHECK(hwnd_);
146 146
147 // The window procedure should have set the data for us. 147 // The window procedure should have set the data for us.
148 DCHECK(win_util::GetWindowUserData(hwnd_) == this); 148 DCHECK(win_util::GetWindowUserData(hwnd_) == this);
149 } 149 }
150 150
151 HICON WindowImpl::GetDefaultWindowIcon() const { 151 HICON WindowImpl::GetDefaultWindowIcon() const {
152 return NULL; 152 return NULL;
153 } 153 }
154 154
155 // static
156 bool WindowImpl::IsWindowImpl(HWND hwnd) {
157 wchar_t tmp[128];
158 if (!::GetClassName(hwnd, tmp, 128))
159 return false;
160
161 std::wstring class_name(tmp);
162 return class_name.find(kBaseClassName) == 0;
163 }
164
155 LRESULT WindowImpl::OnWndProc(UINT message, WPARAM w_param, LPARAM l_param) { 165 LRESULT WindowImpl::OnWndProc(UINT message, WPARAM w_param, LPARAM l_param) {
156 LRESULT result = 0; 166 LRESULT result = 0;
157 167
158 // Handle the message if it's in our message map; otherwise, let the system 168 // Handle the message if it's in our message map; otherwise, let the system
159 // handle it. 169 // handle it.
160 if (!ProcessWindowMessage(hwnd_, message, w_param, l_param, result)) 170 if (!ProcessWindowMessage(hwnd_, message, w_param, l_param, result))
161 result = DefWindowProc(hwnd_, message, w_param, l_param); 171 result = DefWindowProc(hwnd_, message, w_param, l_param);
162 172
163 return result; 173 return result;
164 } 174 }
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
207 class_ex.hIconSm = class_ex.hIcon; 217 class_ex.hIconSm = class_ex.hIcon;
208 ATOM atom = RegisterClassEx(&class_ex); 218 ATOM atom = RegisterClassEx(&class_ex);
209 DCHECK(atom); 219 DCHECK(atom);
210 220
211 Singleton<ClassRegistrar>()->RegisterClass(class_info, name, atom); 221 Singleton<ClassRegistrar>()->RegisterClass(class_info, name, atom);
212 222
213 return name; 223 return name;
214 } 224 }
215 225
216 } // namespace app 226 } // namespace app
OLDNEW
« no previous file with comments | « app/win/window_impl.h ('k') | views/widget/widget_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698