OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/browser/extensions/api/management/management_api.h" | 5 #include "chrome/browser/extensions/api/management/management_api.h" |
6 | 6 |
7 #include <map> | 7 #include <map> |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 286 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
297 BrowserThread::PostTask( | 297 BrowserThread::PostTask( |
298 BrowserThread::IO, | 298 BrowserThread::IO, |
299 FROM_HERE, | 299 FROM_HERE, |
300 base::Bind(&SafeManifestJSONParser::StartWorkOnIOThread, this)); | 300 base::Bind(&SafeManifestJSONParser::StartWorkOnIOThread, this)); |
301 } | 301 } |
302 | 302 |
303 void StartWorkOnIOThread() { | 303 void StartWorkOnIOThread() { |
304 CHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 304 CHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
305 UtilityProcessHost* host = UtilityProcessHost::Create( | 305 UtilityProcessHost* host = UtilityProcessHost::Create( |
306 this, base::MessageLoopProxy::current().get()); | 306 this, base::MessageLoopProxy::current().get()); |
307 host->EnableZygote(); | |
308 host->Send(new ChromeUtilityMsg_ParseJSON(manifest_)); | 307 host->Send(new ChromeUtilityMsg_ParseJSON(manifest_)); |
309 } | 308 } |
310 | 309 |
311 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE { | 310 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE { |
312 bool handled = true; | 311 bool handled = true; |
313 IPC_BEGIN_MESSAGE_MAP(SafeManifestJSONParser, message) | 312 IPC_BEGIN_MESSAGE_MAP(SafeManifestJSONParser, message) |
314 IPC_MESSAGE_HANDLER(ChromeUtilityHostMsg_ParseJSON_Succeeded, | 313 IPC_MESSAGE_HANDLER(ChromeUtilityHostMsg_ParseJSON_Succeeded, |
315 OnJSONParseSucceeded) | 314 OnJSONParseSucceeded) |
316 IPC_MESSAGE_HANDLER(ChromeUtilityHostMsg_ParseJSON_Failed, | 315 IPC_MESSAGE_HANDLER(ChromeUtilityHostMsg_ParseJSON_Failed, |
317 OnJSONParseFailed) | 316 OnJSONParseFailed) |
(...skipping 404 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
722 ProfileKeyedAPIFactory<ManagementAPI>* ManagementAPI::GetFactoryInstance() { | 721 ProfileKeyedAPIFactory<ManagementAPI>* ManagementAPI::GetFactoryInstance() { |
723 return &g_factory.Get(); | 722 return &g_factory.Get(); |
724 } | 723 } |
725 | 724 |
726 void ManagementAPI::OnListenerAdded(const EventListenerInfo& details) { | 725 void ManagementAPI::OnListenerAdded(const EventListenerInfo& details) { |
727 management_event_router_.reset(new ManagementEventRouter(profile_)); | 726 management_event_router_.reset(new ManagementEventRouter(profile_)); |
728 ExtensionSystem::Get(profile_)->event_router()->UnregisterObserver(this); | 727 ExtensionSystem::Get(profile_)->event_router()->UnregisterObserver(this); |
729 } | 728 } |
730 | 729 |
731 } // namespace extensions | 730 } // namespace extensions |
OLD | NEW |