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

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: No change, just reuploading (last attempt was incomplete) 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
« ui/gfx/win/singleton_hwnd.h ('K') | « 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..c24579d2f6a8f3520c41eff542255a89ef265301 100644
--- a/ui/gfx/win/singleton_hwnd.cc
+++ b/ui/gfx/win/singleton_hwnd.cc
@@ -14,17 +14,20 @@ SingletonHwnd* SingletonHwnd::GetInstance() {
return Singleton<SingletonHwnd>::get();
}
-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());
+void SingletonHwnd::Init() {
+ 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());
+}
+
+void SingletonHwnd::AddObserver(Observer* observer) {
+ if (!hwnd())
+ Init();
observer_list_.AddObserver(observer);
}
« ui/gfx/win/singleton_hwnd.h ('K') | « ui/gfx/win/singleton_hwnd.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698