| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/developer_private/developer_private_api.
h" | 5 #include "chrome/browser/extensions/api/developer_private/developer_private_api.
h" |
| 6 | 6 |
| 7 #include <memory> | 7 #include <memory> |
| 8 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "base/files/file_util.h" | 10 #include "base/files/file_util.h" |
| (...skipping 27 matching lines...) Expand all Loading... |
| 38 #include "extensions/common/feature_switch.h" | 38 #include "extensions/common/feature_switch.h" |
| 39 #include "extensions/common/manifest_constants.h" | 39 #include "extensions/common/manifest_constants.h" |
| 40 #include "extensions/common/test_util.h" | 40 #include "extensions/common/test_util.h" |
| 41 #include "extensions/common/value_builder.h" | 41 #include "extensions/common/value_builder.h" |
| 42 | 42 |
| 43 namespace extensions { | 43 namespace extensions { |
| 44 | 44 |
| 45 namespace { | 45 namespace { |
| 46 | 46 |
| 47 std::unique_ptr<KeyedService> BuildAPI(content::BrowserContext* context) { | 47 std::unique_ptr<KeyedService> BuildAPI(content::BrowserContext* context) { |
| 48 return base::WrapUnique(new DeveloperPrivateAPI(context)); | 48 return base::MakeUnique<DeveloperPrivateAPI>(context); |
| 49 } | 49 } |
| 50 | 50 |
| 51 std::unique_ptr<KeyedService> BuildEventRouter( | 51 std::unique_ptr<KeyedService> BuildEventRouter( |
| 52 content::BrowserContext* profile) { | 52 content::BrowserContext* profile) { |
| 53 return base::WrapUnique( | 53 return base::MakeUnique<EventRouter>(profile, ExtensionPrefs::Get(profile)); |
| 54 new EventRouter(profile, ExtensionPrefs::Get(profile))); | |
| 55 } | 54 } |
| 56 | 55 |
| 57 bool HasAllUrlsPermission(const Extension* extension, | 56 bool HasAllUrlsPermission(const Extension* extension, |
| 58 content::BrowserContext* context) { | 57 content::BrowserContext* context) { |
| 59 return ScriptingPermissionsModifier(context, extension).IsAllowedOnAllUrls(); | 58 return ScriptingPermissionsModifier(context, extension).IsAllowedOnAllUrls(); |
| 60 } | 59 } |
| 61 | 60 |
| 62 bool HasPrefsPermission(bool (*has_pref)(const std::string&, | 61 bool HasPrefsPermission(bool (*has_pref)(const std::string&, |
| 63 content::BrowserContext*), | 62 content::BrowserContext*), |
| 64 content::BrowserContext* context, | 63 content::BrowserContext* context, |
| (...skipping 495 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 560 .Append( | 559 .Append( |
| 561 DictionaryBuilder().Set("extensionId", extension->id()).Build()) | 560 DictionaryBuilder().Set("extensionId", extension->id()).Build()) |
| 562 .Build(); | 561 .Build(); |
| 563 function = new api::DeveloperPrivateDeleteExtensionErrorsFunction(); | 562 function = new api::DeveloperPrivateDeleteExtensionErrorsFunction(); |
| 564 EXPECT_TRUE(RunFunction(function, *args)) << function->GetError(); | 563 EXPECT_TRUE(RunFunction(function, *args)) << function->GetError(); |
| 565 // No more errors! | 564 // No more errors! |
| 566 EXPECT_TRUE(error_console->GetErrorsForExtension(extension->id()).empty()); | 565 EXPECT_TRUE(error_console->GetErrorsForExtension(extension->id()).empty()); |
| 567 } | 566 } |
| 568 | 567 |
| 569 } // namespace extensions | 568 } // namespace extensions |
| OLD | NEW |