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 376 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
387 CHECK(parsed_manifest); | 387 CHECK(parsed_manifest); |
388 | 388 |
389 scoped_refptr<Extension> extension = Extension::Create( | 389 scoped_refptr<Extension> extension = Extension::Create( |
390 base::FilePath(), Manifest::INVALID_LOCATION, *parsed_manifest, | 390 base::FilePath(), Manifest::INVALID_LOCATION, *parsed_manifest, |
391 Extension::NO_FLAGS, &error_); | 391 Extension::NO_FLAGS, &error_); |
392 if (!extension.get()) { | 392 if (!extension.get()) { |
393 OnParseFailure(keys::kExtensionCreateError); | 393 OnParseFailure(keys::kExtensionCreateError); |
394 return; | 394 return; |
395 } | 395 } |
396 | 396 |
397 std::vector<std::string> warnings = CreateWarningsList(extension); | 397 std::vector<std::string> warnings = CreateWarningsList(extension.get()); |
398 results_ = management::GetPermissionWarningsByManifest::Results::Create( | 398 results_ = |
399 warnings); | 399 management::GetPermissionWarningsByManifest::Results::Create(warnings); |
400 SendResponse(true); | 400 SendResponse(true); |
401 | 401 |
402 // Matched with AddRef() in RunImpl(). | 402 // Matched with AddRef() in RunImpl(). |
403 Release(); | 403 Release(); |
404 } | 404 } |
405 | 405 |
406 void ManagementGetPermissionWarningsByManifestFunction::OnParseFailure( | 406 void ManagementGetPermissionWarningsByManifestFunction::OnParseFailure( |
407 const std::string& error) { | 407 const std::string& error) { |
408 error_ = error; | 408 error_ = error; |
409 SendResponse(false); | 409 SendResponse(false); |
(...skipping 306 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
716 ProfileKeyedAPIFactory<ManagementAPI>* ManagementAPI::GetFactoryInstance() { | 716 ProfileKeyedAPIFactory<ManagementAPI>* ManagementAPI::GetFactoryInstance() { |
717 return &g_factory.Get(); | 717 return &g_factory.Get(); |
718 } | 718 } |
719 | 719 |
720 void ManagementAPI::OnListenerAdded(const EventListenerInfo& details) { | 720 void ManagementAPI::OnListenerAdded(const EventListenerInfo& details) { |
721 management_event_router_.reset(new ManagementEventRouter(profile_)); | 721 management_event_router_.reset(new ManagementEventRouter(profile_)); |
722 ExtensionSystem::Get(profile_)->event_router()->UnregisterObserver(this); | 722 ExtensionSystem::Get(profile_)->event_router()->UnregisterObserver(this); |
723 } | 723 } |
724 | 724 |
725 } // namespace extensions | 725 } // namespace extensions |
OLD | NEW |