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

Unified Diff: ui/gfx/win/singleton_hwnd.cc

Issue 23812010: Implement first part of supporting global extension commands. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: gclient sync Created 7 years, 2 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/gfx/win/singleton_hwnd.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gfx/win/singleton_hwnd.cc
diff --git a/ui/gfx/win/singleton_hwnd.cc b/ui/gfx/win/singleton_hwnd.cc
index 37993e8f4f0fc05ec40fdca05020e6d55fef9a2d..2de6a8b8a1612d9fabbb6691b94c6499833e23a6 100644
--- a/ui/gfx/win/singleton_hwnd.cc
+++ b/ui/gfx/win/singleton_hwnd.cc
@@ -15,16 +15,6 @@ SingletonHwnd* SingletonHwnd::GetInstance() {
}
void SingletonHwnd::AddObserver(Observer* observer) {
- if (!hwnd()) {
- if (!base::MessageLoop::current() ||
- base::MessageLoop::current()->type() != base::MessageLoop::TYPE_UI) {
- // Creating this window in (e.g.) a renderer inhibits shutdown on
- // Windows. See http://crbug.com/230122 and http://crbug.com/236039.
- DLOG(ERROR) << "Cannot create windows on non-UI thread!";
- return;
- }
- WindowImpl::Init(NULL, Rect());
- }
observer_list_.AddObserver(observer);
}
@@ -47,6 +37,14 @@ BOOL SingletonHwnd::ProcessWindowMessage(HWND window,
}
SingletonHwnd::SingletonHwnd() {
+ if (!base::MessageLoop::current() ||
+ base::MessageLoop::current()->type() != base::MessageLoop::TYPE_UI) {
+ // Creating this window in (e.g.) a renderer inhibits shutdown on
+ // Windows. See http://crbug.com/230122 and http://crbug.com/236039.
+ DLOG(ERROR) << "Cannot create windows on non-UI thread!";
+ return;
+ }
+ WindowImpl::Init(NULL, Rect());
}
SingletonHwnd::~SingletonHwnd() {
« no previous file with comments | « ui/gfx/win/singleton_hwnd.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698