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 305 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
316 OnJSONParseSucceeded) | 316 OnJSONParseSucceeded) |
317 IPC_MESSAGE_HANDLER(ChromeUtilityHostMsg_ParseJSON_Failed, | 317 IPC_MESSAGE_HANDLER(ChromeUtilityHostMsg_ParseJSON_Failed, |
318 OnJSONParseFailed) | 318 OnJSONParseFailed) |
319 IPC_MESSAGE_UNHANDLED(handled = false) | 319 IPC_MESSAGE_UNHANDLED(handled = false) |
320 IPC_END_MESSAGE_MAP() | 320 IPC_END_MESSAGE_MAP() |
321 return handled; | 321 return handled; |
322 } | 322 } |
323 | 323 |
324 void OnJSONParseSucceeded(const base::ListValue& wrapper) { | 324 void OnJSONParseSucceeded(const base::ListValue& wrapper) { |
325 CHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 325 CHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
326 const Value* value = NULL; | 326 const base::Value* value = NULL; |
327 CHECK(wrapper.Get(0, &value)); | 327 CHECK(wrapper.Get(0, &value)); |
328 if (value->IsType(Value::TYPE_DICTIONARY)) | 328 if (value->IsType(base::Value::TYPE_DICTIONARY)) |
329 parsed_manifest_.reset( | 329 parsed_manifest_.reset( |
330 static_cast<const base::DictionaryValue*>(value)->DeepCopy()); | 330 static_cast<const base::DictionaryValue*>(value)->DeepCopy()); |
331 else | 331 else |
332 error_ = keys::kManifestParseError; | 332 error_ = keys::kManifestParseError; |
333 | 333 |
334 BrowserThread::PostTask( | 334 BrowserThread::PostTask( |
335 BrowserThread::UI, | 335 BrowserThread::UI, |
336 FROM_HERE, | 336 FROM_HERE, |
337 base::Bind(&SafeManifestJSONParser::ReportResultFromUIThread, this)); | 337 base::Bind(&SafeManifestJSONParser::ReportResultFromUIThread, this)); |
338 } | 338 } |
(...skipping 386 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
725 ProfileKeyedAPIFactory<ManagementAPI>* ManagementAPI::GetFactoryInstance() { | 725 ProfileKeyedAPIFactory<ManagementAPI>* ManagementAPI::GetFactoryInstance() { |
726 return &g_factory.Get(); | 726 return &g_factory.Get(); |
727 } | 727 } |
728 | 728 |
729 void ManagementAPI::OnListenerAdded(const EventListenerInfo& details) { | 729 void ManagementAPI::OnListenerAdded(const EventListenerInfo& details) { |
730 management_event_router_.reset(new ManagementEventRouter(profile_)); | 730 management_event_router_.reset(new ManagementEventRouter(profile_)); |
731 ExtensionSystem::Get(profile_)->event_router()->UnregisterObserver(this); | 731 ExtensionSystem::Get(profile_)->event_router()->UnregisterObserver(this); |
732 } | 732 } |
733 | 733 |
734 } // namespace extensions | 734 } // namespace extensions |
OLD | NEW |