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

Side by Side Diff: ui/base/win/hwnd_util.cc

Issue 7253016: Merge 88897 - Disables tooltips if we can't create the tooltip window. I still don't (Closed) Base URL: svn://svn.chromium.org/chrome/branches/782/src/
Patch Set: Created 9 years, 5 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 | « no previous file | views/view.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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 "ui/base/win/hwnd_util.h" 5 #include "ui/base/win/hwnd_util.h"
6 6
7 #include "base/string_util.h" 7 #include "base/string_util.h"
8 #include "ui/gfx/rect.h" 8 #include "ui/gfx/rect.h"
9 #include "ui/gfx/size.h" 9 #include "ui/gfx/size.h"
10 10
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after
163 window_bounds.right - window_bounds.left, 163 window_bounds.right - window_bounds.left,
164 window_bounds.bottom - window_bounds.top, 164 window_bounds.bottom - window_bounds.top,
165 SWP_NOACTIVATE | SWP_NOZORDER); 165 SWP_NOACTIVATE | SWP_NOZORDER);
166 } // else case, AdjustWindowToFit set the bounds for us. 166 } // else case, AdjustWindowToFit set the bounds for us.
167 } else { 167 } else {
168 NOTREACHED() << "Unable to adjust window to fit"; 168 NOTREACHED() << "Unable to adjust window to fit";
169 } 169 }
170 } 170 }
171 171
172 void CheckWindowCreated(HWND hwnd) { 172 void CheckWindowCreated(HWND hwnd) {
173 if (hwnd) 173 if (!hwnd)
174 return; 174 LOG_GETLASTERROR(FATAL);
175
176 LPWSTR error_string = NULL;
177 DWORD last_error = GetLastError();
178 FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER |
179 FORMAT_MESSAGE_FROM_SYSTEM,
180 0, // Use the internal message table.
181 last_error,
182 0, // Use default language.
183 reinterpret_cast<LPWSTR>(&error_string),
184 0, // Buffer size.
185 0); // Arguments (unused).
186 // Typical reason for failure is ERROR_NOT_ENOUGH_MEMORY (8).
187 CHECK(false) << "Create failed error=" << last_error <<
188 " message=" << error_string;
189 } 175 }
190 176
191 } // namespace ui 177 } // namespace ui
OLDNEW
« no previous file with comments | « no previous file | views/view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698