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 "extensions/browser/api/management/management_api.h" | 5 #include "extensions/browser/api/management/management_api.h" |
6 | 6 |
7 #include <memory> | 7 #include <memory> |
8 #include <string> | 8 #include <string> |
9 #include <utility> | 9 #include <utility> |
10 #include <vector> | 10 #include <vector> |
(...skipping 328 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
339 return true; | 339 return true; |
340 } else { | 340 } else { |
341 // TODO(lfg) add error string | 341 // TODO(lfg) add error string |
342 OnParseFailure(""); | 342 OnParseFailure(""); |
343 return false; | 343 return false; |
344 } | 344 } |
345 } | 345 } |
346 | 346 |
347 void ManagementGetPermissionWarningsByManifestFunction::OnParseSuccess( | 347 void ManagementGetPermissionWarningsByManifestFunction::OnParseSuccess( |
348 std::unique_ptr<base::Value> value) { | 348 std::unique_ptr<base::Value> value) { |
349 if (!value->IsType(base::Value::TYPE_DICTIONARY)) { | 349 if (!value->IsType(base::Value::Type::DICTIONARY)) { |
350 OnParseFailure(keys::kManifestParseError); | 350 OnParseFailure(keys::kManifestParseError); |
351 return; | 351 return; |
352 } | 352 } |
353 const base::DictionaryValue* parsed_manifest = | 353 const base::DictionaryValue* parsed_manifest = |
354 static_cast<const base::DictionaryValue*>(value.get()); | 354 static_cast<const base::DictionaryValue*>(value.get()); |
355 | 355 |
356 scoped_refptr<Extension> extension = | 356 scoped_refptr<Extension> extension = |
357 Extension::Create(base::FilePath(), Manifest::INVALID_LOCATION, | 357 Extension::Create(base::FilePath(), Manifest::INVALID_LOCATION, |
358 *parsed_manifest, Extension::NO_FLAGS, &error_); | 358 *parsed_manifest, Extension::NO_FLAGS, &error_); |
359 if (!extension) { | 359 if (!extension) { |
(...skipping 524 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
884 ManagementAPI::GetFactoryInstance() { | 884 ManagementAPI::GetFactoryInstance() { |
885 return g_factory.Pointer(); | 885 return g_factory.Pointer(); |
886 } | 886 } |
887 | 887 |
888 void ManagementAPI::OnListenerAdded(const EventListenerInfo& details) { | 888 void ManagementAPI::OnListenerAdded(const EventListenerInfo& details) { |
889 management_event_router_.reset(new ManagementEventRouter(browser_context_)); | 889 management_event_router_.reset(new ManagementEventRouter(browser_context_)); |
890 EventRouter::Get(browser_context_)->UnregisterObserver(this); | 890 EventRouter::Get(browser_context_)->UnregisterObserver(this); |
891 } | 891 } |
892 | 892 |
893 } // namespace extensions | 893 } // namespace extensions |
OLD | NEW |