OLD | NEW |
---|---|
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "apps/app_shim/app_shim_host_manager_mac.h" | 5 #include "apps/app_shim/app_shim_host_manager_mac.h" |
6 | 6 |
7 #include "apps/app_shim/app_shim_handler_mac.h" | |
7 #include "apps/app_shim/app_shim_host_mac.h" | 8 #include "apps/app_shim/app_shim_host_mac.h" |
8 #include "base/bind.h" | 9 #include "base/bind.h" |
9 #include "base/files/file_path.h" | 10 #include "base/files/file_path.h" |
10 #include "base/logging.h" | 11 #include "base/logging.h" |
11 #include "base/path_service.h" | 12 #include "base/path_service.h" |
12 #include "chrome/browser/browser_process.h" | 13 #include "chrome/browser/browser_process.h" |
13 #include "chrome/common/chrome_paths.h" | 14 #include "chrome/common/chrome_paths.h" |
14 #include "content/public/browser/browser_thread.h" | 15 #include "content/public/browser/browser_thread.h" |
15 #include "chrome/common/mac/app_mode_common.h" | 16 #include "chrome/common/mac/app_mode_common.h" |
16 | 17 |
17 using content::BrowserThread; | 18 using content::BrowserThread; |
18 | 19 |
19 namespace { | 20 namespace { |
20 | 21 |
21 void CreateAppShimHost(const IPC::ChannelHandle& handle) { | 22 void CreateAppShimHost(const IPC::ChannelHandle& handle) { |
22 // AppShimHost takes ownership of itself. | 23 // AppShimHost takes ownership of itself. |
23 (new AppShimHost)->ServeChannel(handle); | 24 (new AppShimHost)->ServeChannel(handle); |
24 } | 25 } |
25 | 26 |
26 } // namespace | 27 } // namespace |
27 | 28 |
28 AppShimHostManager::AppShimHostManager() { | 29 AppShimHostManager::AppShimHostManager() { |
29 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 30 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
31 apps::AppShimHandler::SetDefaultHandler(&extension_app_shim_handler_); | |
tapted
2013/05/23 02:29:39
You need to remove it in the destructor as well, o
jackhou1
2013/05/23 06:10:19
Done.
| |
30 BrowserThread::PostTask( | 32 BrowserThread::PostTask( |
31 BrowserThread::FILE, FROM_HERE, | 33 BrowserThread::FILE, FROM_HERE, |
32 base::Bind(&AppShimHostManager::InitOnFileThread, | 34 base::Bind(&AppShimHostManager::InitOnFileThread, |
33 base::Unretained(this))); | 35 base::Unretained(this))); |
34 } | 36 } |
35 | 37 |
36 AppShimHostManager::~AppShimHostManager() { | 38 AppShimHostManager::~AppShimHostManager() { |
37 } | 39 } |
38 | 40 |
39 void AppShimHostManager::InitOnFileThread() { | 41 void AppShimHostManager::InitOnFileThread() { |
(...skipping 22 matching lines...) Expand all Loading... | |
62 const IPC::ChannelHandle& handle) { | 64 const IPC::ChannelHandle& handle) { |
63 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 65 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
64 BrowserThread::PostTask( | 66 BrowserThread::PostTask( |
65 BrowserThread::UI, FROM_HERE, | 67 BrowserThread::UI, FROM_HERE, |
66 base::Bind(&CreateAppShimHost, handle)); | 68 base::Bind(&CreateAppShimHost, handle)); |
67 } | 69 } |
68 | 70 |
69 void AppShimHostManager::OnListenError() { | 71 void AppShimHostManager::OnListenError() { |
70 // TODO(jeremya): set a timeout and attempt to reconstruct the channel. | 72 // TODO(jeremya): set a timeout and attempt to reconstruct the channel. |
71 } | 73 } |
OLD | NEW |