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 "chrome_frame/external_tab.h" | 5 #include "chrome_frame/external_tab.h" |
6 #include "base/singleton.h" | 6 #include "base/lazy_instance.h" |
7 #include "base/tracked.h" | 7 #include "base/tracked.h" |
8 #include "base/task.h" | 8 #include "base/task.h" |
9 #include "base/waitable_event.h" | 9 #include "base/waitable_event.h" |
10 #include "chrome/common/automation_messages.h" | 10 #include "chrome/common/automation_messages.h" |
11 #include "chrome_frame/utils.h" | 11 #include "chrome_frame/utils.h" |
12 | 12 |
13 DISABLE_RUNNABLE_METHOD_REFCOUNT(ExternalTabProxy); | 13 DISABLE_RUNNABLE_METHOD_REFCOUNT(ExternalTabProxy); |
14 DISABLE_RUNNABLE_METHOD_REFCOUNT(UIDelegate); | 14 DISABLE_RUNNABLE_METHOD_REFCOUNT(UIDelegate); |
15 | 15 |
16 namespace { | 16 namespace { |
17 Singleton<ChromeProxyFactory> g_proxy_factory; | 17 static base::LazyInstance<ChromeProxyFactory> g_proxy_factory( |
| 18 base::LINKER_INITIALIZED); |
18 | 19 |
19 struct UserDataHolder : public SyncMessageContext { | 20 struct UserDataHolder : public SyncMessageContext { |
20 explicit UserDataHolder(void* p) : data(p) {} | 21 explicit UserDataHolder(void* p) : data(p) {} |
21 void* data; | 22 void* data; |
22 }; | 23 }; |
23 } | 24 } |
24 | 25 |
25 | 26 |
26 ExternalTabProxy::ExternalTabProxy() : state_(NONE), tab_(0), tab_wnd_(NULL), | 27 ExternalTabProxy::ExternalTabProxy() : state_(NONE), tab_(0), tab_wnd_(NULL), |
27 chrome_wnd_(NULL), proxy_factory_(g_proxy_factory.get()), proxy_(NULL), | 28 chrome_wnd_(NULL), proxy_factory_(g_proxy_factory.Pointer()), proxy_(NULL), |
28 ui_delegate_(NULL) { | 29 ui_delegate_(NULL) { |
29 } | 30 } |
30 | 31 |
31 ExternalTabProxy::~ExternalTabProxy() { | 32 ExternalTabProxy::~ExternalTabProxy() { |
32 Destroy(); | 33 Destroy(); |
33 } | 34 } |
34 | 35 |
35 void ExternalTabProxy::Init() { | 36 void ExternalTabProxy::Init() { |
36 if (m_hWnd == NULL) { | 37 if (m_hWnd == NULL) { |
37 // Create a window on the UI thread for marshaling messages back and forth | 38 // Create a window on the UI thread for marshaling messages back and forth |
(...skipping 293 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
331 } | 332 } |
332 | 333 |
333 void ExternalTabProxy::TabClosed() { | 334 void ExternalTabProxy::TabClosed() { |
334 // TODO(stoyan): | 335 // TODO(stoyan): |
335 } | 336 } |
336 | 337 |
337 void ExternalTabProxy::AttachTab( | 338 void ExternalTabProxy::AttachTab( |
338 const IPC::AttachExternalTabParams& attach_params) { | 339 const IPC::AttachExternalTabParams& attach_params) { |
339 // TODO(stoyan): | 340 // TODO(stoyan): |
340 } | 341 } |
OLD | NEW |