| OLD | NEW |
| 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 "gfx/window_impl.h" |
| 6 | 6 |
| 7 #include <list> | 7 #include <list> |
| 8 | 8 |
| 9 #include "base/logging.h" | |
| 10 #include "base/singleton.h" | 9 #include "base/singleton.h" |
| 11 #include "base/string_number_conversions.h" | 10 #include "base/string_number_conversions.h" |
| 12 #include "base/win_util.h" | 11 #include "base/win_util.h" |
| 13 | 12 |
| 14 namespace gfx { | 13 namespace gfx { |
| 15 | 14 |
| 16 static const DWORD kWindowDefaultChildStyle = | 15 static const DWORD kWindowDefaultChildStyle = |
| 17 WS_CHILD | WS_VISIBLE | WS_CLIPCHILDREN | WS_CLIPSIBLINGS; | 16 WS_CHILD | WS_VISIBLE | WS_CLIPCHILDREN | WS_CLIPSIBLINGS; |
| 18 static const DWORD kWindowDefaultStyle = WS_OVERLAPPEDWINDOW; | 17 static const DWORD kWindowDefaultStyle = WS_OVERLAPPEDWINDOW; |
| 19 static const DWORD kWindowDefaultExStyle = 0; | 18 static const DWORD kWindowDefaultExStyle = 0; |
| (...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 146 DCHECK(hwnd_); | 145 DCHECK(hwnd_); |
| 147 | 146 |
| 148 // The window procedure should have set the data for us. | 147 // The window procedure should have set the data for us. |
| 149 DCHECK(win_util::GetWindowUserData(hwnd_) == this); | 148 DCHECK(win_util::GetWindowUserData(hwnd_) == this); |
| 150 } | 149 } |
| 151 | 150 |
| 152 HICON WindowImpl::GetDefaultWindowIcon() const { | 151 HICON WindowImpl::GetDefaultWindowIcon() const { |
| 153 return NULL; | 152 return NULL; |
| 154 } | 153 } |
| 155 | 154 |
| 156 void WindowImpl::set_initial_class_style(UINT class_style) { | |
| 157 // We dynamically generate the class name, so don't register it globally! | |
| 158 DCHECK_EQ((class_style & CS_GLOBALCLASS), 0u); | |
| 159 class_style_ = class_style; | |
| 160 } | |
| 161 | |
| 162 // static | 155 // static |
| 163 bool WindowImpl::IsWindowImpl(HWND hwnd) { | 156 bool WindowImpl::IsWindowImpl(HWND hwnd) { |
| 164 wchar_t tmp[128]; | 157 wchar_t tmp[128]; |
| 165 if (!::GetClassName(hwnd, tmp, 128)) | 158 if (!::GetClassName(hwnd, tmp, 128)) |
| 166 return false; | 159 return false; |
| 167 | 160 |
| 168 std::wstring class_name(tmp); | 161 std::wstring class_name(tmp); |
| 169 return class_name.find(kBaseClassName) == 0; | 162 return class_name.find(kBaseClassName) == 0; |
| 170 } | 163 } |
| 171 | 164 |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 224 class_ex.hIconSm = class_ex.hIcon; | 217 class_ex.hIconSm = class_ex.hIcon; |
| 225 ATOM atom = RegisterClassEx(&class_ex); | 218 ATOM atom = RegisterClassEx(&class_ex); |
| 226 DCHECK(atom); | 219 DCHECK(atom); |
| 227 | 220 |
| 228 Singleton<ClassRegistrar>()->RegisterClass(class_info, name, atom); | 221 Singleton<ClassRegistrar>()->RegisterClass(class_info, name, atom); |
| 229 | 222 |
| 230 return name; | 223 return name; |
| 231 } | 224 } |
| 232 | 225 |
| 233 } // namespace gfx | 226 } // namespace gfx |
| OLD | NEW |